Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BotConfiguration ¶
type Configuration ¶
type Configuration struct { Bot BotConfiguration `yaml:"bot" json:"bot" env:"BOT,prefix=BOT_"` Repository RepositoryConfiguration `yaml:"repository" json:"repository" env:"REPOSITORY,prefix=REPOSITORY_"` Logging LoggerConfiguration `yaml:"logging" json:"logging" env:"LOGGING,prefix=LOGGING_"` }
Configuration is the configuration of the bot.
func CreateConfigurationFromEnv ¶
func CreateConfigurationFromEnv(prefix string) (cfg *Configuration, err error)
func CreateConfigurationFromEnvFile ¶
func CreateConfigurationFromEnvFile(prefix string, filenames ...string) (cfg *Configuration, err error)
func CreateConfigurationFromFile ¶
func CreateConfigurationFromFile(filename string) (cfg *Configuration, err error)
func (*Configuration) FixDefaults ¶
func (cfg *Configuration) FixDefaults() *Configuration
FixDefaults checks and fixes the configuration of defaults values.
type LoggerConfiguration ¶
type LoggerConfiguration struct { Level string `yaml:"level" json:"level" env:"LEVEL,default=info"` FormatTimeStamp string `yaml:"format_time_stamp" json:"format_time_stamp" env:"FORMAT_TIME_STAMP,default=2006-01-02 15:04:05"` Format string `yaml:"log_format" json:"log_format" env:"LOG_FORMAT,default=%time% %lvl% [%name%] %msg%\n"` LogLevel logrus.Level `yaml:"-" json:"-"` }
LoggerConfiguration is the configuration for the logger
func (*LoggerConfiguration) FixDefaults ¶
func (cfg *LoggerConfiguration) FixDefaults() LoggerConfiguration
type RepositoryConfiguration ¶
Click to show internal directories.
Click to hide internal directories.