Documentation ¶
Overview ¶
* User: cr-mao Date: 2023/9/5 18:28 Email: crmao@qq.com Desc: etcd.go
Index ¶
- func Marshal(ins *registry.ServiceInstance) (string, error)
- type EtcdClient
- func (c *EtcdClient) GetByKey(ctx context.Context, key string) (*registry.ServiceInstance, error)
- func (c *EtcdClient) GetServerInstances(ctx context.Context, namespace, serviceName string) (res []*registry.ServiceInstance, err error)
- func (c *EtcdClient) Pub(ctx context.Context, key string, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EtcdClient ¶
type EtcdClient struct {
// contains filtered or unexported fields
}
var GlobalEtcdClient *EtcdClient
func NewEtcdClient ¶
func NewEtcdClient(addrs []string, dialTimeout time.Duration) *EtcdClient
内网不需要账号,密码
func (*EtcdClient) GetByKey ¶
func (c *EtcdClient) GetByKey(ctx context.Context, key string) (*registry.ServiceInstance, error)
func (*EtcdClient) GetServerInstances ¶
func (c *EtcdClient) GetServerInstances(ctx context.Context, namespace, serviceName string) (res []*registry.ServiceInstance, err error)
Click to show internal directories.
Click to hide internal directories.