config

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2018 License: MPL-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

View Source
const (
	KeyLogLevel = "log.level"

	KeyCRDBDatabase = "crdb.database"
	KeyCRDBHost     = "crdb.host"
	KeyCRDBPort     = "crdb.port"
	KeyCRDBUser     = "crdb.user"
	KeyCRDBPassword = "crdb.password"
	KeyCRDBMode     = "crdb.mode"

	KeyAgentLogFormat = "agent.log-format"

	KeyGoogleAgentEnable = "gops.enable"
	KeyGoogleAgentBind   = "gops.bind"
	KeyGoogleAgentPort   = "gops.port"

	KeyPProfEnable = "pprof.enable"
	KeyPProfBind   = "pprof.bind"
	KeyPProfPort   = "pprof.port"

	KeyHTTPServerBind = "http.bind"
	KeyHTTPServerPort = "http.port"

	KeyTritonDC        = "triton.dc"
	KeyTritonURL       = "triton.url"
	KeyTritonAuthURL   = "triton.auth-url"
	KeyTritonKeyPrefix = "triton.key-prefix"
	KeyTritonWhitelist = "triton.whitelist"

	KeyNomadURL  = "nomad.url"
	KeyNomadPort = "nomad.port"
)
View Source
const (
	// Use a log format that resembles time.RFC3339Nano but includes all trailing
	// zeros so that we get fixed-width logging.
	LogTimeFormat = "2006-01-02T15:04:05.000000000Z07:00"
)

Variables

This section is empty.

Functions

func IsDebug

func IsDebug() bool

IsDebug returns true when the server is configured for debug level

Types

type Agent

type Agent struct {
	LogFormat LogFormat
}

type Config

type Config struct {
	DBPool
	Agent
	HTTPServer
	Nomad
}

func NewDefault

func NewDefault() (cfg *Config, err error)

type DBPool

type DBPool = pgx.ConnPoolConfig

type HTTPServer

type HTTPServer struct {
	Bind            string
	Port            uint16
	Logger          zerolog.Logger
	DC              string
	TritonURL       string
	AuthURL         string
	KeyNamePrefix   string
	EnableWhitelist bool
}

type LogFormat

type LogFormat uint
const (
	LogFormatAuto LogFormat = iota
	LogFormatZerolog
	LogFormatHuman
)

func LogLevelParse

func LogLevelParse(s string) (LogFormat, error)

func (LogFormat) String

func (f LogFormat) String() string

type Nomad

type Nomad struct {
	Addr      string
	Port      uint16
	TLSConfig *nomad.TLSConfig
}

type PGXLogger

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

func (*PGXLogger) Log

func (l *PGXLogger) Log(level pgx.LogLevel, msg string, data map[string]interface{})

Custom logging facade that implements the pgx.Logger interface in order to log through Zerolog

Jump to

Keyboard shortcuts

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