Documentation ¶
Index ¶
- type ConfigBackend
- func (cb *ConfigBackend) Delete(key string) error
- func (cb *ConfigBackend) Get(key string) (string, error)
- func (cb *ConfigBackend) GetRecursive(key string) ([]*model.ConfigNode, error)
- func (cb *ConfigBackend) GetWithDefault(key string, defaultValue string) (string, error)
- func (cb *ConfigBackend) Set(key string, value string) (string, error)
- func (cb *ConfigBackend) SetWithTTL(key string, value string, ttl uint64) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigBackend ¶
type ConfigBackend struct {
// contains filtered or unexported fields
}
ConfigBackend is an etcd-based implementation of the config.Backend interface
func NewConfigBackend ¶
func NewConfigBackend() (*ConfigBackend, error)
NewConfigBackend returns this etcd-based implementation of the config.Backend interface
func (*ConfigBackend) Delete ¶
func (cb *ConfigBackend) Delete(key string) error
Delete a key/value pair by key from etcd
func (*ConfigBackend) Get ¶
func (cb *ConfigBackend) Get(key string) (string, error)
Get a value by key from etcd
func (*ConfigBackend) GetRecursive ¶
func (cb *ConfigBackend) GetRecursive(key string) ([]*model.ConfigNode, error)
GetRecursive returns a slice of all key/value pairs "under" a specified key in etcd
func (*ConfigBackend) GetWithDefault ¶ added in v1.10.0
func (cb *ConfigBackend) GetWithDefault(key string, defaultValue string) (string, error)
GetWithDefault gets a value by key from etcd and return a default value if not found
func (*ConfigBackend) Set ¶
func (cb *ConfigBackend) Set(key string, value string) (string, error)
Set a value for the specified key in etcd
func (*ConfigBackend) SetWithTTL ¶
SetWithTTL sets a value for the specified key in etcd-- with a time to live
Click to show internal directories.
Click to hide internal directories.