Documentation
¶
Overview ¶
Package config provides the configuration for the application.
Index ¶
Constants ¶
View Source
const ( ModeDevelopment = "development" ModeProduction = "production" )
View Source
const ( LogFormatJSON = "json" LogFormatText = "text" )
View Source
const (
DriverSqlite3 = "sqlite3"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { conf.Version Mode string `yaml:"mode" conf:"default:development"` // development or production Web WebConfig `yaml:"web"` Storage Storage `yaml:"storage"` Log LoggerConf `yaml:"logger"` Mailer MailerConf `yaml:"mailer"` Demo bool `yaml:"demo"` Debug DebugConf `yaml:"debug"` Options Options `yaml:"options"` }
type LoggerConf ¶
type MailerConf ¶
type MailerConf struct { Host string `conf:""` Port int `conf:""` Username string `conf:""` Password string `conf:""` From string `conf:""` }
func (*MailerConf) Ready ¶
func (mc *MailerConf) Ready() bool
Ready is a simple check to ensure that the configuration is not empty. or with it's default state.
type WebConfig ¶
type WebConfig struct { Port string `yaml:"port" conf:"default:7745"` Host string `yaml:"host"` MaxUploadSize int64 `yaml:"max_file_upload" conf:"default:10"` ReadTimeout time.Duration `yaml:"read_timeout" conf:"default:10s"` WriteTimeout time.Duration `yaml:"write_timeout" conf:"default:10s"` IdleTimeout time.Duration `yaml:"idle_timeout" conf:"default:30s"` }
Click to show internal directories.
Click to hide internal directories.