config

package
v0.0.0-...-9489dbf Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2017 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTemplate

func ApplyTemplate(config []byte) ([]byte, error)

ApplyTemplate creates and renders a template from the given config template

func RenderConfig

func RenderConfig(configFlag, renderFlag string) error

RenderConfig renders the templated config in configFlag to renderFlag.

Types

type Config

type Config struct {
	Discovery   discovery.Backend
	LogConfig   *LogConfig
	StopTimeout int
	Jobs        []*jobs.Config
	Watches     []*watches.Config
	Telemetry   *telemetry.Config
	Control     *control.Config
}

Config contains the parsed config elements

func LoadConfig

func LoadConfig(configFlag string) (*Config, error)

LoadConfig loads, parses, and validates the configuration

func (*Config) InitLogging

func (cfg *Config) InitLogging() error

InitLogging configure logrus with the new log config if available

type DefaultLogFormatter

type DefaultLogFormatter struct {
}

DefaultLogFormatter delegates formatting to standard go log package

func (*DefaultLogFormatter) Format

func (f *DefaultLogFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format formats the logrus entry by passing it to the "log" package

type Environment

type Environment map[string]string

Environment is a map of environment variables to their values

type LogConfig

type LogConfig struct {
	Level  string `json:"level"`
	Format string `json:"format"`
	Output string `json:"output"`
}

LogConfig configures the log levels

type RFC3339logWriter

type RFC3339logWriter struct {
}

RFC3339logWriter io.Writer that outputs RFC3339 dates

func (RFC3339logWriter) Write

func (writer RFC3339logWriter) Write(bytes []byte) (int, error)

type Template

type Template struct {
	Template *template.Template
	Env      Environment
}

Template encapsulates a golang template and its associated environment variables.

func NewTemplate

func NewTemplate(config []byte) (*Template, error)

NewTemplate creates a Template parsed from the configuration and the current environment variables

func (*Template) Execute

func (c *Template) Execute() ([]byte, error)

Execute renders the template

Jump to

Keyboard shortcuts

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