Documentation ¶
Index ¶
- Constants
- func GetPathRelativeToConfig(configuration *viper.Viper, key string) string
- func ParseBugsnag(configuration *viper.Viper) (*bugsnag.Configuration, error)
- func ParseLogLevel(configuration *viper.Viper, defaultLevel logrus.Level) (logrus.Level, error)
- func ParseServerTLS(configuration *viper.Viper, tlsRequired bool) (*tls.Config, error)
- func ParseViper(v *viper.Viper, configFile string) error
- func RootHandlerFactory(auth auth.AccessController, ctx context.Context, trust signed.CryptoService) func(contextHandler, ...string) *rootHandler
- func SetUpBugsnag(config *bugsnag.Configuration) error
- func SetupViper(configuration *viper.Viper, envPrefix string)
- type Storage
Constants ¶
const ( MemoryBackend = "memory" MySQLBackend = "mysql" SqliteBackend = "sqlite3" )
Specifies the list of recognized backends
Variables ¶
This section is empty.
Functions ¶
func GetPathRelativeToConfig ¶
GetPathRelativeToConfig gets a configuration key which is a path, and if it is not empty or an absolute path, returns the absolute path relative to the configuration file
func ParseBugsnag ¶
ParseBugsnag tries to parse out a Bugsnag Configuration from a Viper. If no values are provided, returns a nil pointer.
func ParseLogLevel ¶
ParseLogLevel tries to parse out a log level from a Viper. If there is no configuration, defaults to the provided error level
func ParseServerTLS ¶
ParseServerTLS tries to parse out valid server TLS options from a Viper. The cert/key files are relative to the config file used to populate the instance of viper.
func ParseViper ¶
ParseViper tries to parse out a Viper from a configuration file.
func RootHandlerFactory ¶
func RootHandlerFactory(auth auth.AccessController, ctx context.Context, trust signed.CryptoService) func(contextHandler, ...string) *rootHandler
RootHandlerFactory creates a new rootHandler factory using the given Context creator and authorizer. The returned factory allows creating new rootHandlers from the alternate http handler contextHandler and a scope.
func SetUpBugsnag ¶
func SetUpBugsnag(config *bugsnag.Configuration) error
SetUpBugsnag configures bugsnag and sets up a logrus hook
func SetupViper ¶
SetupViper sets up an instance of viper to also look at environment variables
Types ¶
type Storage ¶
Storage is a configuration about what storage backend a server should use
func ParseStorage ¶
ParseStorage tries to parse out Storage from a Viper. If backend and URL are not provided, returns a nil pointer. Storage is required (if a backend is not provided, an error will be returned.)