Documentation ¶
Index ¶
- Variables
- type EphemeralKV
- type EtcdClient
- type RemoteKV
- func GetRemoteKV(kv v3.KV, key string) (*RemoteKV, error)
- func NewKV(kv v3.KV, key, val string, leaseID v3.LeaseID) (*RemoteKV, error)
- func NewKey(kv v3.KV, key string, leaseID v3.LeaseID) (*RemoteKV, error)
- func NewSequentialKV(kv v3.KV, prefix, val string) (*RemoteKV, error)
- func NewUniqueKV(kv v3.KV, prefix string, val string, leaseID v3.LeaseID) (*RemoteKV, error)
- func NewUniqueKey(kv v3.KV, prefix string) (*RemoteKV, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type EphemeralKV ¶
type EphemeralKV struct{ RemoteKV }
EphemeralKV is a new key associated with a session lease
func NewEphemeralKV ¶
func NewEphemeralKV(client *v3.Client, key, val string) (*EphemeralKV, error)
NewEphemeralKV creates a new key/value pair associated with a session lease
func NewUniqueEphemeralKV ¶
func NewUniqueEphemeralKV(client *v3.Client, prefix, val string) (ek *EphemeralKV, err error)
NewUniqueEphemeralKV creates a new unique key/value pair associated with a session lease
func NewUniqueEphemeralKey ¶
func NewUniqueEphemeralKey(client *v3.Client, prefix string) (*EphemeralKV, error)
NewUniqueEphemeralKey creates a new unique valueless key associated with a session lease
type EtcdClient ¶
func NewEtcdClient ¶
func NewEtcdClient(cfg *config.Config) (*EtcdClient, error)
NewEtcdClient creates an etcd client based on the provided config.
func (*EtcdClient) GetClient ¶
func (c *EtcdClient) GetClient() *v3.Client
func (*EtcdClient) TestEtcdClient ¶
func (c *EtcdClient) TestEtcdClient() error
TestEtcdClient verifies a client is functional. It will attempt to connect to the etcd server and block until the server responds at least once, or return an error if the server never responded.
type RemoteKV ¶
type RemoteKV struct {
// contains filtered or unexported fields
}
RemoteKV is a key/revision pair created by the client and stored on etcd
func NewSequentialKV ¶
NewSequentialKV allocates a new sequential key-value pair at <prefix>/nnnnn