{"modulePath":"github.com/AliceO2Group/Control","version":"v1.51.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cfgbackend\n\nPackage configuration defines the Source interface as the main access point to O² Configuration backends. Consul and YAML backends are also provided.\n\n## Types\n\n```go\ntype Array []Item\n```\n\n```go\nfunc (m Array) Array() Array\n```\n\n```go\nfunc (m Array) DeepCopy() Item\n```\n\n```go\nfunc (m Array) Map() Map\n```\n\n```go\nfunc (m Array) Type() ItemType\n```\n\n```go\nfunc (m Array) Value() string\n```\n\n```go\ntype ConsulSource struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewConsulSource(uri string) (cc *ConsulSource, err error)\n```\n\n```go\nfunc (cc *ConsulSource) Exists(key string) (exists bool, err error)\n```\n\n```go\nfunc (cc *ConsulSource) Get(key string) (value string, err error)\n```\n\n```go\nfunc (cc *ConsulSource) GetKeysByPrefix(keyPrefix string) (keys []string, err error)\n```\n\n```go\nfunc (cc *ConsulSource) GetNextUInt32(key string) (value uint32, err error)\n```\n\n```go\nfunc (cc *ConsulSource) GetRecursive(key string) (value Item, err error)\n```\n\n```go\nfunc (cc *ConsulSource) GetRecursiveYaml(key string) (value []byte, err error)\n```\n\n```go\nfunc (cc *ConsulSource) GetWithLastIndex(key string) (value string, lastIndex uint64, err error)\n```\n\n```go\nfunc (cc *ConsulSource) IsDir(key string) (isDir bool)\n```\n\n```go\nfunc (cc *ConsulSource) Put(key string, value string) (err error)\n```\n\n```go\nfunc (cc *ConsulSource) PutRecursive(string, Item) error\n```\n\n```go\nfunc (cc *ConsulSource) PutRecursiveYaml(string, []byte) error\n```\n\n```go\ntype Item interface {\n\tType() ItemType\n\tValue() string\n\tMap() Map\n\tArray() Array\n\tDeepCopy() Item\n}\n```\n\n```go\ntype ItemType int\n```\n\n```go\nconst (\n\tIT_Value ItemType = iota\n\tIT_Map\n\tIT_Array\n)\n```\n\n```go\ntype Map map[string]Item\n```\n\n```go\nfunc (m Map) Array() Array\n```\n\n```go\nfunc (m Map) DeepCopy() Item\n```\n\n```go\nfunc (m Map) Map() Map\n```\n\n```go\nfunc (m Map) Type() ItemType\n```\n\n```go\nfunc (m Map) Value() string\n```\n\n```go\ntype MockSource struct{}\n```\nMockSource is a minimal mock implementation of the Source interface\n\n```go\nfunc NewMockSource() (*MockSource, error)\n```\n\n```go\nfunc (m *MockSource) Exists(key string) (bool, error)\n```\n\n```go\nfunc (m *MockSource) Get(key string) (string, error)\n```\n\n```go\nfunc (m *MockSource) GetKeysByPrefix(prefix string) ([]string, error)\n```\n\n```go\nfunc (m *MockSource) GetRecursive(key string) (Item, error)\n```\n\n```go\nfunc (m *MockSource) GetRecursiveYaml(key string) ([]byte, error)\n```\n\n```go\nfunc (m *MockSource) IsDir(key string) bool\n```\n\n```go\nfunc (m *MockSource) Put(key, value string) error\n```\n\n```go\nfunc (m *MockSource) PutRecursive(key string, item Item) error\n```\n\n```go\nfunc (m *MockSource) PutRecursiveYaml(key string, data []byte) error\n```\n\n```go\ntype ROSource interface {\n\tGet(string) (string, error)\n\tGetKeysByPrefix(string) ([]string, error)\n\tGetRecursive(string) (Item, error)\n\tGetRecursiveYaml(string) ([]byte, error)\n\tExists(string) (bool, error)\n\tIsDir(string) bool\n}\n```\nRead-Only Source\n\n```go\ntype Source interface {\n\tROSource\n\tPut(string, string) error\n\tPutRecursive(string, Item) error\n\tPutRecursiveYaml(string, []byte) error\n}\n```\n\n```go\nfunc NewSource(uri string) (configuration Source, err error)\n```\n\n```go\ntype String string\n```\n\n```go\nfunc (s String) Array() Array\n```\n\n```go\nfunc (s String) DeepCopy() Item\n```\n\n```go\nfunc (s String) Map() Map\n```\n\n```go\nfunc (s String) Type() ItemType\n```\n\n```go\nfunc (s String) Value() string\n```\n\n```go\ntype YamlSource struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (yc *YamlSource) Exists(key string) (exists bool, err error)\n```\n\n```go\nfunc (yc *YamlSource) Get(key string) (value string, err error)\n```\n\n```go\nfunc (yc *YamlSource) GetKeysByPrefix(keyPrefix string) (keys []string, err error)\n```\n\n```go\nfunc (yc *YamlSource) GetRecursive(key string) (value Item, err error)\n```\n\n```go\nfunc (yc *YamlSource) GetRecursiveYaml(key string) (value []byte, err error)\n```\n\n```go\nfunc (yc *YamlSource) IsDir(key string) (isDir bool)\n```\n\n```go\nfunc (yc *YamlSource) Put(key string, value string) (err error)\n```\n\n```go\nfunc (yc *YamlSource) PutRecursive(key string, value Item) (err error)\n```\n\n```go\nfunc (yc *YamlSource) PutRecursiveYaml(key string, value []byte) (err error)\n```\n\n","path":"github.com/AliceO2Group/Control/configuration/cfgbackend","name":"cfgbackend","synopsis":"Package configuration defines the Source interface as the main access point to O² Configuration backends.","isRedistributable":true}
