Files
ocis/pkg/config/config.go
T

66 lines
1.3 KiB
Go
Raw Normal View History

2020-02-14 15:42:48 +01:00
package config
// Log defines the available logging configuration.
type Log struct {
Level string
Pretty bool
Color bool
}
// Debug defines the available debug configuration.
type Debug struct {
Addr string
Token string
Pprof bool
Zpages bool
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string
Namespace string
Root string
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool
Type string
Endpoint string
Collector string
Service string
}
// Asset defines the available asset configuration.
type Asset struct {
Path string
}
2020-03-04 10:22:57 +01:00
// Policy enables us to use multiple directors.
type Policy struct {
Name string `mapstructure:"name"`
Routes []Route `mapstructure:"routes"`
2020-03-04 10:22:57 +01:00
}
2020-02-24 13:21:02 +01:00
// Route define forwarding routes
type Route struct {
Endpoint string `mapstructure:"endpoint"`
Backend string `mapstructure:"backend"`
ApacheVHost bool `mapstructure:"apache-vhost"`
2020-02-24 13:21:02 +01:00
}
2020-02-14 15:42:48 +01:00
// Config combines all available configuration parts.
type Config struct {
2020-03-04 10:22:57 +01:00
File string
Log Log
Debug Debug
HTTP HTTP
Tracing Tracing
Asset Asset
Policies []Policy `mapstructure:"policies"`
2020-02-14 15:42:48 +01:00
}
// New initializes a new configuration with or without defaults.
func New() *Config {
return &Config{}
}