Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LeaseTTL int64 = 10
Functions ¶
func BuildEtcdTarget ¶
BuildEtcdTarget returns a string that represents the given endpoints with etcd schema.
Types ¶
type EtcdClient ¶
type EtcdClient interface { ActiveConnection() *grpc.ClientConn Close() error Ctx() context.Context Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error) Grant(ctx context.Context, ttl int64) (*clientv3.LeaseGrantResponse, error) KeepAlive(ctx context.Context, id clientv3.LeaseID) (<-chan *clientv3.LeaseKeepAliveResponse, error) Put(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error) Revoke(ctx context.Context, id clientv3.LeaseID) (*clientv3.LeaseRevokeResponse, error) Watch(ctx context.Context, key string, opts ...clientv3.OpOption) clientv3.WatchChan }
EtcdClient interface represents an etcd client.
func NewEtcdCli ¶
func NewEtcdCli(endpoints []string) (EtcdClient, error)
type EtcdConf ¶
type EtcdConf struct { Hosts []string Key string ID int64 `json:",optional"` User string `json:",optional"` Pass string `json:",optional"` CertFile string `json:",optional"` CertKeyFile string `json:",optional=CertFile"` CACertFile string `json:",optional=CertFile"` InsecureSkipVerify bool `json:",optional"` }
EtcdConf is the config item with the given key on etcd.
func (EtcdConf) HasAccount ¶
HasAccount returns if account provided.
type EtcdRegistry ¶
type EtcdRegistry struct {
// contains filtered or unexported fields
}
func NewEtcdRegistry ¶
func NewEtcdRegistry(etcdConf EtcdConf, listenOn string) *EtcdRegistry
func (*EtcdRegistry) Register ¶
func (e *EtcdRegistry) Register() error
type EtcdResolver ¶
type EtcdResolver struct {
// contains filtered or unexported fields
}
func NewEtcdResolver ¶
func NewEtcdResolver() *EtcdResolver
func (*EtcdResolver) Build ¶
func (e *EtcdResolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
func (*EtcdResolver) Scheme ¶
func (e *EtcdResolver) Scheme() string
Click to show internal directories.
Click to hide internal directories.