Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidEnsignCredentials = errors.New("invalid configuration: must specify either path to ensign credentials or the client id and api key")
)
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"`
Origin string `default:"https://rtnl.link"`
AltOrigin string `split_words:"true" default:"https://r8l.co"`
Storage StorageConfig
Ensign EnsignConfig
// 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.
func (*Config) MakeOriginURLs ¶ added in v1.0.0
type EnsignConfig ¶ added in v1.1.0
type EnsignConfig struct {
Maintenance bool `env:"RTNL_MAINTENANCE"`
Path string `required:"false"`
ClientID string `split_words:"true"`
ClientSecret string `split_words:"true"`
Topic string `default:"shortcrust-production"`
}
func (EnsignConfig) Options ¶ added in v1.1.0
func (c EnsignConfig) Options() ensign.Option
func (EnsignConfig) Validate ¶ added in v1.1.0
func (c EnsignConfig) Validate() error
type StorageConfig ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.