config

package
v0.0.0-...-d76060a Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServiceName is an identifier-like name used anywhere this app needs to be identified.
	ServiceName = "hollowtrees"

	// FriendlyServiceName is the visible name of the service.
	FriendlyServiceName = "Hollowtrees"

	// ConfigEnvPrefix defines the prefix that ENVIRONMENT variables will use
	ConfigEnvPrefix = "HT"
)

Variables

This section is empty.

Functions

func Configure

func Configure(v *viper.Viper, p *pflag.FlagSet)

Configure configures some defaults in the Viper instance

func ErrorHandler

func ErrorHandler(logger log.Logger) emperror.Handler

ErrorHandler returns an error handler.

Types

type Config

type Config struct {
	// Meaningful values are recommended (eg. production, development, staging, release/123, etc)
	Environment string

	// Turns on some debug functionality (eg. more verbose logs)
	Debug bool

	// Log configuration
	Log log.Config

	// Healthcheck configuration
	Healthcheck healthcheck.Config

	// Prometheus alert handler configuration
	Promalert promalert.Config
}

Config holds any kind of configuration that comes from the outside world and is necessary for running the application

func (Config) Validate

func (c Config) Validate() error

Validate validates the configuration

Jump to

Keyboard shortcuts

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