config

package
v0.0.0-...-666a0c5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const Version = "0.1.0"

Variables

View Source
var Config = initConfig()
View Source
var GitHash = "unknown"
View Source
var LogLevelNames = map[string]int{"debug": 5, "info": 4, "warning": 3, "error": 2, "critical": 1, "fatal": 0}

LogLevelNames give convenient, easier to remember than number name for the different levels of logging.

Functions

func ParseConfigOptions

func ParseConfigOptions() error

Types

type Conf

type Conf struct {
	ConsulHttpAddr string `toml:"consul-http-addr"`
	UserKeyPrefix  string `toml:"user-key-prefix"`
	DebugLevel     int
	LogLevel       string `toml:"log-level"`
	LogFile        string `toml:log-file"`
	SysLog         bool   `toml:"syslog"`
	StateFile      string `toml:"state-file"`
}

type Options

type Options struct {
	Version        bool   `short:"v" long:"version" description:"Print version info."`
	ConfFile       string `short:"c" long:"config" description:"Specify a config file to use." env:"SPQR_CONFIG_FILE"`
	ConsulHttpAddr string `` /* 211-byte string literal not displayed */
	UserKeyPrefix  string `` /* 142-byte string literal not displayed */
	LogFile        string `short:"L" long:"log-file" description:"Log to file X" env:"SPQR_LOG_FILE"`
	SysLog         bool   `` /* 129-byte string literal not displayed */
	LogLevel       string `` /* 272-byte string literal not displayed */
	StateFile      string `short:"s" long:"statefile" description:"Store spqr's state in this file."`
	Verbose        []bool `short:"V" long:"verbose" description:"Show verbose debug information. Repeat for more verbosity."`
}

Jump to

Keyboard shortcuts

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