Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("etcdwrapper: key not found")
Functions ¶
func GetEtcdClient ¶
func GetEtcdClient(ctx context.Context, certificates *Certificates, endpoints ...string) (*clientv3.Client, error)
GetEtcdClient returns an etcd client connected to the specified endpoints. If no endpoints are provided, endpoints are retrieved from the provided runtime config. If the runtime config does not list any endpoints, the default endpoint is used. The returned client should be closed when no longer needed, in order to avoid leaking GRPC client goroutines.
func WaitForEtcd ¶ added in v0.21.0
func WaitForEtcd(parentCtx context.Context, certificates *Certificates, endpoints ...string) error
Types ¶
type Certificates ¶
type Certificates struct {
CaCert string
ServerCert string
ServerKey string
}
type Client ¶ added in v0.21.0
type Client interface {
List(ctx context.Context, key string) ([]Value, error)
Watch(ctx context.Context, key string) clientv3.WatchChan
Get(ctx context.Context, key string) (Value, error)
Put(ctx context.Context, key string, value []byte) error
Delete(ctx context.Context, key string) error
Close() error
}
func New ¶ added in v0.21.0
func New(ctx context.Context, certificates *Certificates, endpoints ...string) (Client, error)
func NewFromConfig ¶ added in v0.21.0
func NewFromConfig(ctx context.Context, vConfig *config.VirtualClusterConfig) (Client, error)
Click to show internal directories.
Click to hide internal directories.