config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2018 License: MIT Imports: 9 Imported by: 7

Documentation

Index

Constants

View Source
const (
	YML_CFG_KEY_SYS  = "global.system"
	YML_CFG_KEY_COMP = "global.components"
	YML_CFG_KEY_PPL  = "global.pipeline"
)

Variables

This section is empty.

Functions

func Get

func Get(key string) (interface{}, bool)

func GetAll

func GetAll() map[string]interface{}

func GetOrDefault

func GetOrDefault(key string, def interface{}) (interface{}, bool)

func Register

func Register(key string, prov Provider) error

func Resolve

func Resolve() error

Types

type CfgBlockComponent

type CfgBlockComponent struct {
	Module      string
	Plugin      string
	Constructor string
	Params      map[string]interface{}
}

type CfgBlockPipeline

type CfgBlockPipeline struct {
	Links   []string
	Connect string
	Routes  map[string]string
}

type CfgBlockSystem

type CfgBlockSystem struct {
	Maxprocs int
	Admin    CfgBlockSystemAdmin
	Metrics  CfgBlockSystemMetrics
}

type CfgBlockSystemAdmin

type CfgBlockSystemAdmin struct {
	Enabled  bool
	BindAddr string `yaml:"bind_addr"`
}

type CfgBlockSystemMetrics added in v0.0.2

type CfgBlockSystemMetrics struct {
	Enabled  bool
	Interval int
	Receiver CfgBlockSystemMetricsReceiver
}

type CfgBlockSystemMetricsReceiver added in v0.0.2

type CfgBlockSystemMetricsReceiver struct {
	Type   string
	Params map[string]string
}

type Provider

type Provider interface {
	Setup() error
	DependsOn() []string
	Resolve() error
	GetName() string
	GetWeight() uint32
	GetOptions() ProviderOptions
	GetValue(string) (interface{}, bool)
}

type ProviderList added in v0.0.2

type ProviderList []Provider

func (ProviderList) Len added in v0.0.2

func (p ProviderList) Len() int

func (ProviderList) Less added in v0.0.2

func (p ProviderList) Less(i, j int) bool

func (ProviderList) Swap added in v0.0.2

func (p ProviderList) Swap(i, j int)

type ProviderOptions

type ProviderOptions uint64
const (
	ProviderOptionsFileCache ProviderOptions = 1 << iota
	ProviderOptionsTrustOldCache
)

type Registry

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

type YAMLConfig

type YAMLConfig struct {
	System     *CfgBlockSystem
	Components map[string]CfgBlockComponent
	Pipeline   map[string]CfgBlockPipeline
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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