Documentation ¶
Index ¶
- Variables
- func CloseDefaultEtcdClient() error
- func InitDefaultEtcdClient(opt *SEtcdOptions, onKeepaliveFailure func()) error
- type SEtcdClient
- func (cli *SEtcdClient) Close() error
- func (cli *SEtcdClient) Delete(ctx context.Context, key string) ([]byte, error)
- func (cli *SEtcdClient) Get(ctx context.Context, key string) ([]byte, error)
- func (cli *SEtcdClient) GetClient() *clientv3.Client
- func (cli *SEtcdClient) List(ctx context.Context, prefix string) ([]SEtcdKeyValue, error)
- func (cli *SEtcdClient) Put(ctx context.Context, key string, val string) error
- func (cli *SEtcdClient) PutSession(ctx context.Context, key string, val string) error
- func (cli *SEtcdClient) PutWithLease(ctx context.Context, key string, val string, ttlSeconds int64) error
- func (cli *SEtcdClient) RestartSession() error
- func (cli *SEtcdClient) RestartSessionWithContext(ctx context.Context) error
- func (cli *SEtcdClient) SessionLiving() bool
- func (cli *SEtcdClient) Unwatch(prefix string)
- func (cli *SEtcdClient) Watch(ctx context.Context, prefix string, onCreate TEtcdCreateEventFunc, ...) error
- type SEtcdKeyValue
- type SEtcdOptions
- type SEtcdWatcher
- type TEtcdCreateEventFunc
- type TEtcdDeleteEventFunc
- type TEtcdModifyEventFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoSuchKey = errors.Error("No such key")
)
Functions ¶
func CloseDefaultEtcdClient ¶
func CloseDefaultEtcdClient() error
func InitDefaultEtcdClient ¶
func InitDefaultEtcdClient(opt *SEtcdOptions, onKeepaliveFailure func()) error
Types ¶
type SEtcdClient ¶
type SEtcdClient struct {
// contains filtered or unexported fields
}
func Default ¶
func Default() *SEtcdClient
func NewEtcdClient ¶
func NewEtcdClient(opt *SEtcdOptions, onKeepaliveFailure func()) (*SEtcdClient, error)
func (*SEtcdClient) Close ¶
func (cli *SEtcdClient) Close() error
func (*SEtcdClient) GetClient ¶
func (cli *SEtcdClient) GetClient() *clientv3.Client
func (*SEtcdClient) List ¶
func (cli *SEtcdClient) List(ctx context.Context, prefix string) ([]SEtcdKeyValue, error)
func (*SEtcdClient) PutSession ¶
func (*SEtcdClient) PutWithLease ¶
func (*SEtcdClient) RestartSession ¶
func (cli *SEtcdClient) RestartSession() error
func (*SEtcdClient) RestartSessionWithContext ¶
func (cli *SEtcdClient) RestartSessionWithContext(ctx context.Context) error
func (*SEtcdClient) SessionLiving ¶
func (cli *SEtcdClient) SessionLiving() bool
func (*SEtcdClient) Unwatch ¶
func (cli *SEtcdClient) Unwatch(prefix string)
func (*SEtcdClient) Watch ¶
func (cli *SEtcdClient) Watch( ctx context.Context, prefix string, onCreate TEtcdCreateEventFunc, onModify TEtcdModifyEventFunc, onDelete TEtcdDeleteEventFunc, ) error
type SEtcdKeyValue ¶
type SEtcdOptions ¶
type SEtcdOptions struct { EtcdEndpoint []string `help:"etcd endpoints in format of addr:port"` EtcdTimeoutSeconds int `default:"5" help:"etcd dial timeout in seconds"` EtcdRequestTimeoutSeconds int `default:"2" help:"etcd request timeout in seconds"` EtcdLeaseExpireSeconds int `default:"5" help:"etcd expire timeout in seconds"` EtcdNamspace string `help:"etcd namespace"` EtcdUsername string `help:"etcd username"` EtcdPassword string `help:"etcd password"` EtcdEnabldSsl bool `help:"enable SSL/TLS"` EtcdSslCertfile string `help:"ssl certification file"` EtcdSslKeyfile string `help:"ssl certification private key file"` EtcdSslCaCertfile string `help:"ssl ca certification file"` TLSConfig *tls.Config `help:"tls config"` }
type SEtcdWatcher ¶
type SEtcdWatcher struct {
// contains filtered or unexported fields
}
func (*SEtcdWatcher) Cancel ¶
func (w *SEtcdWatcher) Cancel()
type TEtcdCreateEventFunc ¶
type TEtcdDeleteEventFunc ¶
type TEtcdModifyEventFunc ¶
Click to show internal directories.
Click to hide internal directories.