config

package
v0.0.0-...-0765a50 Latest Latest
Warning

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

Go to latest
Published: May 14, 2017 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Config store the active merge configuration
	Config = &Options{}
	// CLI store the configuration fetched from the console line
	CLI = &Options{}
	// File store the configuration fetched from an optional file
	File = &Options{}

	// Filepath is the path of the loaded configuration file
	Filepath string
)

Functions

func Apply

func Apply() (err error)

Apply validate configuration and initialize needed package with values from configuration

func ApplyLoggingOptions

func ApplyLoggingOptions(lc *logOptions) (err error)

ApplyLoggingOptions apply configuration on log package

func LoadFile

func LoadFile(filepath string) (err error)

LoadFile fill config.File with the configuration parsed from path

func Merge

func Merge()

Merge fill config.Config based on config.CLI and config.File File < CLI

func SaveFile

func SaveFile() (err error)

SaveFile save the current configuration to a file

Types

type Options

type Options struct {
	Global globalOptions `json:"global"`
	Run    runOptions    `json:"run"`
}

Options list all the available configurations

type TLSOptions

type TLSOptions struct {
	Key           string `json:"key" validate:"file=omitempty+readable"`
	KeyPassword   string `json:"key_password"`
	ClientsCACert string `json:"clients_ca_cert" validate:"file=readable"`
	Cert          string `json:"cert" validate:"string=nonempty"`
}

TLSOptions store required TLS options

Jump to

Keyboard shortcuts

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