Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Maintenance bool `default:"false" yaml:"maintenance"`
Mode string `default:"release"`
LogLevel logger.LevelDecoder `split_words:"true" default:"info" yaml:"log_level"`
ConsoleLog bool `split_words:"true" default:"false" yaml:"console_log"`
BindAddr string `split_words:"true" default:":8765" yaml:"bind_addr"`
AllowOrigins []string `split_words:"true" default:"http://localhost:8765"`
// contains filtered or unexported fields
}
Config contains all of the configuration parameters for an rtnl server and is loaded from the environment or a configuration file with reasonable defaults for values that are omitted. The Config should be validated in preparation for running the server to ensure that all server operations work as expected.
func New ¶
New creates and processes a Config from the environment ready for use. If the configuration is invalid or it cannot be processed an error is returned.
func (Config) GetLogLevel ¶
Parse and return the zerolog log level for configuring global logging.
func (Config) IsZero ¶
A Config is zero-valued if it hasn't been processed by a file or the environment.
Click to show internal directories.
Click to hide internal directories.