Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateEventFunc ¶
CreateEventFunc defines etcd create event function handler.
type DeleteEventFunc ¶
DeleteEventFunc defines etcd delete event function handler.
type Options ¶
type Options struct { Endpoints []string `json:"endpoints" mapstructure:"endpoints"` Username string `json:"username" mapstructure:"username"` Password string `json:"password" mapstructure:"password"` Namespace string `json:"namespace" mapstructure:"namespace"` TLS TLSOptions `json:"tls" mapstructure:"tls"` Timeout time.Duration `json:"timeout" mapstructure:"timeout"` RequestTimeout time.Duration `json:"request-timeout" mapstructure:"request-timeout"` LeaseExpire time.Duration `json:"lease-expire" mapstructure:"lease-expire"` }
Options defines options for etcd cluster.
type Store ¶
type Store interface { RawClient() *clientv3.Client Put(ctx context.Context, key string, val string) error PutWithSession(ctx context.Context, key string, val string) error PutWithLease(ctx context.Context, key string, val string, ttlSeconds int64) error Get(ctx context.Context, key string) ([]byte, error) List(ctx context.Context, prefix string) ([]KeyValue, error) Delete(ctx context.Context, key string) ([]byte, error) Watch(ctx context.Context, prefix string, onCreate CreateEventFunc, onUpdate UpdateEventFunc, onDelete DeleteEventFunc) error Unwatch(prefix string) Close() error }
Store defines the interface of etcd store.
type TLSOptions ¶
type TLSOptions struct { Enabled bool `json:"enabled" mapstructure:"enabled"` // CertFile is a file containing a PEM-encoded certificate, and possibly the complete certificate chain CertFile string `json:"cert-file" mapstructure:"cert-file"` // KeyFile is a file containing a PEM-encoded private key for the certificate specified by CertFile KeyFile string `json:"private-key-file" mapstructure:"private-key-file"` }
TLSOptions contains configuration for TLS.
type UpdateEventFunc ¶
UpdateEventFunc defines etcd update event function handler.
Click to show internal directories.
Click to hide internal directories.