Documentation ¶
Overview ¶
Package configuration defines the Source interface as the main access point to O² Configuration backends. Consul and YAML backends are also provided.
Index ¶
- type Array
- type ConsulSource
- func (cc *ConsulSource) Exists(key string) (exists bool, err error)
- func (cc *ConsulSource) Get(key string) (value string, err error)
- func (cc *ConsulSource) GetKeysByPrefix(keyPrefix string) (keys []string, err error)
- func (cc *ConsulSource) GetNextUInt32(key string) (value uint32, err error)
- func (cc *ConsulSource) GetRecursive(key string) (value Item, err error)
- func (cc *ConsulSource) GetRecursiveYaml(key string) (value []byte, err error)
- func (cc *ConsulSource) GetWithLastIndex(key string) (value string, lastIndex uint64, err error)
- func (cc *ConsulSource) IsDir(key string) (isDir bool)
- func (cc *ConsulSource) Put(key string, value string) (err error)
- func (cc *ConsulSource) PutRecursive(string, Item) error
- func (cc *ConsulSource) PutRecursiveYaml(string, []byte) error
- type Item
- type ItemType
- type Map
- type MockSource
- func (m *MockSource) Exists(key string) (bool, error)
- func (m *MockSource) Get(key string) (string, error)
- func (m *MockSource) GetKeysByPrefix(prefix string) ([]string, error)
- func (m *MockSource) GetRecursive(key string) (Item, error)
- func (m *MockSource) GetRecursiveYaml(key string) ([]byte, error)
- func (m *MockSource) IsDir(key string) bool
- func (m *MockSource) Put(key, value string) error
- func (m *MockSource) PutRecursive(key string, item Item) error
- func (m *MockSource) PutRecursiveYaml(key string, data []byte) error
- type ROSource
- type Source
- type String
- type YamlSource
- func (yc *YamlSource) Exists(key string) (exists bool, err error)
- func (yc *YamlSource) Get(key string) (value string, err error)
- func (yc *YamlSource) GetKeysByPrefix(keyPrefix string) (keys []string, err error)
- func (yc *YamlSource) GetRecursive(key string) (value Item, err error)
- func (yc *YamlSource) GetRecursiveYaml(key string) (value []byte, err error)
- func (yc *YamlSource) IsDir(key string) (isDir bool)
- func (yc *YamlSource) Put(key string, value string) (err error)
- func (yc *YamlSource) PutRecursive(key string, value Item) (err error)
- func (yc *YamlSource) PutRecursiveYaml(key string, value []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsulSource ¶
type ConsulSource struct {
// contains filtered or unexported fields
}
func NewConsulSource ¶
func NewConsulSource(uri string) (cc *ConsulSource, err error)
func (*ConsulSource) GetKeysByPrefix ¶
func (cc *ConsulSource) GetKeysByPrefix(keyPrefix string) (keys []string, err error)
func (*ConsulSource) GetNextUInt32 ¶
func (cc *ConsulSource) GetNextUInt32(key string) (value uint32, err error)
func (*ConsulSource) GetRecursive ¶
func (cc *ConsulSource) GetRecursive(key string) (value Item, err error)
func (*ConsulSource) GetRecursiveYaml ¶
func (cc *ConsulSource) GetRecursiveYaml(key string) (value []byte, err error)
func (*ConsulSource) GetWithLastIndex ¶ added in v0.29.2
func (cc *ConsulSource) GetWithLastIndex(key string) (value string, lastIndex uint64, err error)
func (*ConsulSource) IsDir ¶
func (cc *ConsulSource) IsDir(key string) (isDir bool)
func (*ConsulSource) PutRecursive ¶
func (cc *ConsulSource) PutRecursive(string, Item) error
func (*ConsulSource) PutRecursiveYaml ¶
func (cc *ConsulSource) PutRecursiveYaml(string, []byte) error
type MockSource ¶ added in v1.21.0
type MockSource struct{}
MockSource is a minimal mock implementation of the Source interface
func NewMockSource ¶ added in v1.21.0
func NewMockSource() (*MockSource, error)
func (*MockSource) GetKeysByPrefix ¶ added in v1.21.0
func (m *MockSource) GetKeysByPrefix(prefix string) ([]string, error)
func (*MockSource) GetRecursive ¶ added in v1.21.0
func (m *MockSource) GetRecursive(key string) (Item, error)
func (*MockSource) GetRecursiveYaml ¶ added in v1.21.0
func (m *MockSource) GetRecursiveYaml(key string) ([]byte, error)
func (*MockSource) IsDir ¶ added in v1.21.0
func (m *MockSource) IsDir(key string) bool
func (*MockSource) Put ¶ added in v1.21.0
func (m *MockSource) Put(key, value string) error
func (*MockSource) PutRecursive ¶ added in v1.21.0
func (m *MockSource) PutRecursive(key string, item Item) error
func (*MockSource) PutRecursiveYaml ¶ added in v1.21.0
func (m *MockSource) PutRecursiveYaml(key string, data []byte) error
type ROSource ¶
type ROSource interface { Get(string) (string, error) GetKeysByPrefix(string) ([]string, error) GetRecursive(string) (Item, error) GetRecursiveYaml(string) ([]byte, error) Exists(string) (bool, error) IsDir(string) bool }
Read-Only Source
type Source ¶
type YamlSource ¶
type YamlSource struct {
// contains filtered or unexported fields
}
func (*YamlSource) GetKeysByPrefix ¶
func (yc *YamlSource) GetKeysByPrefix(keyPrefix string) (keys []string, err error)
func (*YamlSource) GetRecursive ¶
func (yc *YamlSource) GetRecursive(key string) (value Item, err error)
func (*YamlSource) GetRecursiveYaml ¶
func (yc *YamlSource) GetRecursiveYaml(key string) (value []byte, err error)
func (*YamlSource) IsDir ¶
func (yc *YamlSource) IsDir(key string) (isDir bool)
func (*YamlSource) PutRecursive ¶
func (yc *YamlSource) PutRecursive(key string, value Item) (err error)
func (*YamlSource) PutRecursiveYaml ¶
func (yc *YamlSource) PutRecursiveYaml(key string, value []byte) (err error)
Click to show internal directories.
Click to hide internal directories.