github.com/aaabigfish/gopkg@v1.1.0/etcdv3/README.md (about)

     1  # etcdv3
     2  
     3  etcdv3库,基于 [etcdv3](go.etcd.io/etcd/client/v3) 封装,默认配置在项目conf/config.toml,配置模版如下:
     4  ```
     5  [etcd]
     6  Endpoints = ["192.168.1.157:34234"]
     7  Username = ""
     8  Password = ""
     9  
    10  ```
    11  
    12  
    13  # 示例
    14  ```go
    15  import "gitlab.ipcloud.cc/go/gopkg/etcdv3"
    16  
    17  client := etcdv3.NewClient(context.Background, []string{"addr:port1", "addr2:port2", "addr3:port3"}, etcdv3.ClientOptions{})
    18  
    19  client.Put("test_key", "value")
    20  client.Get("test_key")
    21  
    22  ```