configuration

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2016 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORSConfig

type CORSConfig struct {
	Debug   bool     `yaml:"debug"`
	Origins []string `yaml:"origins"`
	Methods []string `yaml:"methods"`
	Headers []string `yaml:"headers"`
}

type Config

type Config struct {
	Log        LogConfig  `yaml:"logging"`
	Containers Driver     `yaml:"containers"`
	HTTP       HTTPConfig `yaml:"http"`
	Storage    Driver     `yaml:"storage"`
}

func Parse

func Parse(rd io.Reader) (*Config, error)

func Resolve

func Resolve(args []string) (*Config, error)

type Driver

type Driver map[string]Parameters

func (Driver) MarshalYAML

func (driver Driver) MarshalYAML() (interface{}, error)

func (Driver) Parameters

func (driver Driver) Parameters() Parameters

func (Driver) Type

func (driver Driver) Type() string

func (*Driver) UnmarshalText

func (driver *Driver) UnmarshalText(text []byte) error

func (*Driver) UnmarshalYAML

func (driver *Driver) UnmarshalYAML(unmarshal func(interface{}) error) error

type HTTPConfig

type HTTPConfig struct {
	Enabled bool       `yaml:"enabled"`
	Addr    string     `yaml:"addr"`
	Host    string     `yaml:"host"`
	CORS    CORSConfig `yaml:"cors"`
}

type LogConfig

type LogConfig struct {
	Level     LogLevel               `yaml:"level,omitempty"`
	Formatter string                 `yaml:"formatter,omitempty"`
	Fields    map[string]interface{} `yaml:"fields,omitempty"`
}

type LogLevel

type LogLevel string

func (*LogLevel) UnmarshalYAML

func (logLevel *LogLevel) UnmarshalYAML(unmarshal func(interface{}) error) error

type Parameters

type Parameters map[string]interface{}

type Parser

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

func NewParser

func NewParser(prefix string, parseInfos []VersionedParseInfo) *Parser

func (*Parser) Parse

func (p *Parser) Parse(in []byte, v interface{}) error

type Version

type Version string

func MajorMinorVersion

func MajorMinorVersion(major uint, minor uint) Version

func (Version) Major

func (version Version) Major() uint

func (Version) Minor

func (version Version) Minor() uint

func (*Version) UnmarshalYAML

func (version *Version) UnmarshalYAML(unmarshal func(interface{}) error) error

type VersionedParseInfo

type VersionedParseInfo struct {
	Version Version

	ParseAs reflect.Type

	ConversionFunc func(interface{}) (interface{}, error)
}

Jump to

Keyboard shortcuts

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