uniconf

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IncludeListElementName = "from"
)

Variables

This section is empty.

Functions

func AddPhase

func AddPhase(phase *Phase)

func AddSource

func AddSource(source SourceHandler)

func Collect

func Collect(jsonPath, key string) string

func Config

func Config() map[string]interface{}

func DeepCollectChildren

func DeepCollectChildren(inputs []interface{}) (interface{}, error)

func Execute

func Execute()

func FlattenConfig

func FlattenConfig(inputs []interface{}) (interface{}, error)

func FromProcess

func FromProcess(source interface{}, path string, phase *Phase) (result interface{}, processed, mergeToParent, removeParentKey bool, replaceSource interface{})

func GetJSON added in v0.1.3

func GetJSON() (yamlString string)

func GetYAML added in v0.1.3

func GetYAML() (yamlString string)

func InterpolateProcess

func InterpolateProcess(source interface{}, path string, phase *Phase) (result interface{}, processed, mergeToParent, removeParentKey bool, replaceSource interface{})

func InterpolateString

func InterpolateString(input string, config map[string]interface{}) string

func Load

func Load(inputs []interface{}) (interface{}, error)

Load loads configuration.

func PrintConfig

func PrintConfig(inputs []interface{}) (interface{}, error)

func ProcessContext

func ProcessContext(inputs []interface{}) (interface{}, error)

func ProcessKeys

func ProcessKeys(inputs []interface{}) (interface{}, error)

ProcessKeys processes configuration.

func SetContext

func SetContext(inputs []interface{}) (interface{}, error)

func SetRootSource

func SetRootSource(sourceName string)

Types

type Callback

type Callback struct {
	Args   []interface{}
	Method func([]interface{}) (interface{}, error)
}

type ConfigEntity

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

func NewConfigEntity

func NewConfigEntity(s *Source, configMap map[string]interface{}) (*ConfigEntity, error)

type Phase

type Phase struct {
	Name        string
	Args        []interface{}
	Callback    func([]interface{}) (interface{}, error)
	Phases      []*Phase
	ParentPhase *Phase
	Result      *interface{}
	Error       *error
}

type Processor

type Processor struct {
	IncludeKeys []string
	ExcludeKeys []string
	Callback    func(source interface{}, path string, phase *Phase) (result interface{}, processed, mergeToParent, removeParentKey bool, replaceSource interface{})
}

type Source

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

func NewSource

func NewSource(sourceName string, sourceMap map[string]interface{}) *Source

func (*Source) Autoload

func (s *Source) Autoload() string

func (*Source) ConfigEntity

func (s *Source) ConfigEntity(id string) (*ConfigEntity, bool)

func (*Source) GetIncludeConfigEntityIds

func (s *Source) GetIncludeConfigEntityIds(scenarioID string) ([]string, error)

func (*Source) IsLoaded

func (s *Source) IsLoaded() bool

func (*Source) LoadConfigEntity

func (s *Source) LoadConfigEntity(configMap map[string]interface{}) (*ConfigEntity, error)

func (*Source) LoadSource

func (s *Source) LoadSource() error

func (*Source) Name

func (s *Source) Name() string

func (*Source) Path

func (s *Source) Path() string

type SourceConfigMap

type SourceConfigMap struct {
	Source
	// contains filtered or unexported fields
}

func NewSourceConfigMap

func NewSourceConfigMap(sourceName string, sourceMap map[string]interface{}) *SourceConfigMap

func (*SourceConfigMap) GetIncludeConfigEntityIds

func (s *SourceConfigMap) GetIncludeConfigEntityIds(scenarioID string) ([]string, error)

func (*SourceConfigMap) LoadConfigEntity

func (s *SourceConfigMap) LoadConfigEntity(configMap map[string]interface{}) (*ConfigEntity, error)

type SourceEnv

type SourceEnv struct {
	Source
}

func NewSourceEnv

func NewSourceEnv(sourceName string, sourceMap map[string]interface{}) *SourceEnv

func (*SourceEnv) GetIncludeConfigEntityIds

func (s *SourceEnv) GetIncludeConfigEntityIds(scenarioID string) ([]string, error)

func (*SourceEnv) LoadConfigEntity

func (s *SourceEnv) LoadConfigEntity(configMap map[string]interface{}) (*ConfigEntity, error)

type SourceFile

type SourceFile struct {
	Source
	// contains filtered or unexported fields
}

func NewSourceFile

func NewSourceFile(sourceName string, sourceMap map[string]interface{}) *SourceFile

func (*SourceFile) GetIncludeConfigEntityIds

func (s *SourceFile) GetIncludeConfigEntityIds(id string) ([]string, error)

func (*SourceFile) LoadConfigEntity

func (s *SourceFile) LoadConfigEntity(configMap map[string]interface{}) (*ConfigEntity, error)

func (*SourceFile) Path

func (s *SourceFile) Path() string

type SourceGoGetter added in v0.1.7

type SourceGoGetter struct {
	SourceFile
	// contains filtered or unexported fields
}

func NewSourceGoGetter added in v0.1.7

func NewSourceGoGetter(sourceName string, url string) *SourceGoGetter

func (*SourceGoGetter) LoadSource added in v0.1.7

func (s *SourceGoGetter) LoadSource() error

type SourceHandler

type SourceHandler interface {
	Name() string
	Path() string
	Autoload() string
	LoadSource() error
	IsLoaded() bool
	GetIncludeConfigEntityIds(scenarioID string) ([]string, error)
	LoadConfigEntity(configMap map[string]interface{}) (*ConfigEntity, error)
	ConfigEntity(id string) (*ConfigEntity, bool)
}

type SourceRepo

type SourceRepo struct {
	SourceFile
	// contains filtered or unexported fields
}

func NewSourceRepo

func NewSourceRepo(sourceName string, sourceMap map[string]interface{}) *SourceRepo

func (*SourceRepo) LoadSource

func (s *SourceRepo) LoadSource() error

type Uniconf

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

func New

func New() *Uniconf

New returns an initialized Uniconf instance.

func (*Uniconf) Config

func (u *Uniconf) Config() map[string]interface{}

Jump to

Keyboard shortcuts

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