configuration

package
v0.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2019 License: GPL-3.0 Imports: 9 Imported by: 2

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array []Item

func (Array) Array

func (m Array) Array() Array

func (Array) DeepCopy

func (m Array) DeepCopy() Item

func (Array) Map

func (m Array) Map() Map

func (Array) Type

func (m Array) Type() ItemType

func (Array) Value

func (m Array) Value() string

type ConsulSource added in v0.7.0

type ConsulSource struct {
	// contains filtered or unexported fields
}

func (*ConsulSource) Exists added in v0.7.0

func (cc *ConsulSource) Exists(key string) (exists bool, err error)

func (*ConsulSource) Get added in v0.7.0

func (cc *ConsulSource) Get(key string) (value string, err error)

func (*ConsulSource) GetNextUInt32 added in v0.8.2

func (cc *ConsulSource) GetNextUInt32(key string) (value uint32, err error)

func (*ConsulSource) GetRecursive added in v0.7.0

func (cc *ConsulSource) GetRecursive(key string) (value Item, err error)

func (*ConsulSource) GetRecursiveYaml added in v0.7.0

func (cc *ConsulSource) GetRecursiveYaml(key string) (value []byte, err error)

func (*ConsulSource) Put added in v0.7.0

func (cc *ConsulSource) Put(key string, value string) (err error)

func (*ConsulSource) PutRecursive added in v0.7.0

func (cc *ConsulSource) PutRecursive(string, Item) error

func (*ConsulSource) PutRecursiveYaml added in v0.7.0

func (cc *ConsulSource) PutRecursiveYaml(string, []byte) error

type Item

type Item interface {
	Type() ItemType
	Value() string
	Map() Map
	Array() Array
	DeepCopy() Item
}

type ItemType

type ItemType int
const (
	IT_Value ItemType = iota
	IT_Map
	IT_Array
)

type Map

type Map map[string]Item

func (Map) Array

func (m Map) Array() Array

func (Map) DeepCopy

func (m Map) DeepCopy() Item

func (Map) Map

func (m Map) Map() Map

func (Map) Type

func (m Map) Type() ItemType

func (Map) Value

func (m Map) Value() string

type ROSource added in v0.7.0

type ROSource interface {
	Get(string) (string, error)
	GetRecursive(string) (Item, error)
	GetRecursiveYaml(string) ([]byte, error)
	Exists(string) (bool, error)
}

type Source added in v0.7.0

type Source interface {
	ROSource
	Put(string, string) error
	PutRecursive(string, Item) error
	PutRecursiveYaml(string, []byte) error
}

func NewSource added in v0.7.0

func NewSource(uri string) (configuration Source, err error)

type String

type String string

func (String) Array

func (s String) Array() Array

func (String) DeepCopy

func (s String) DeepCopy() Item

func (String) Map

func (s String) Map() Map

func (String) Type

func (s String) Type() ItemType

func (String) Value

func (s String) Value() string

type YamlSource added in v0.7.0

type YamlSource struct {
	// contains filtered or unexported fields
}

func (*YamlSource) Exists added in v0.7.0

func (yc *YamlSource) Exists(key string) (exists bool, err error)

func (*YamlSource) Get added in v0.7.0

func (yc *YamlSource) Get(key string) (value string, err error)

func (*YamlSource) GetRecursive added in v0.7.0

func (yc *YamlSource) GetRecursive(key string) (value Item, err error)

func (*YamlSource) GetRecursiveYaml added in v0.7.0

func (yc *YamlSource) GetRecursiveYaml(key string) (value []byte, err error)

func (*YamlSource) Put added in v0.7.0

func (yc *YamlSource) Put(key string, value string) (err error)

func (*YamlSource) PutRecursive added in v0.7.0

func (yc *YamlSource) PutRecursive(key string, value Item) (err error)

func (*YamlSource) PutRecursiveYaml added in v0.7.0

func (yc *YamlSource) PutRecursiveYaml(key string, value []byte) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL