Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Mysql MysqlConfig HTTP HTTPConfig Redis RedisConfig Logger LoggerConfig Server ServerConfig CacheTTL time.Duration `mapstructure:"ttl"` }
type HTTPConfig ¶
type LoggerConfig ¶
type LoggerConfig struct { Development bool `yaml:"development" mapstructure:"development"` DisableCaller bool `yaml:"disableCaller" mapstructure:"disableCaller"` DisableStacktrace bool `yaml:"disableStacktrace" mapstructure:"disableStacktrace"` Encoding string `yaml:"encoding" mapstructure:"encoding"` LogLevel string `yaml:"level" mapstructure:"level"` LogType LogType `yaml:"logType" mapstructure:"logType"` }
type MysqlConfig ¶
type MysqlConfig struct { Username string `yaml:"username" mapstructure:"username"` Password string `yaml:"password" mapstructure:"password"` Protocol string `yaml:"protocol" mapstructure:"protocol"` Address string `yaml:"address" mapstructure:"address"` Database string `yaml:"database" mapstructure:"database"` Params map[string]string `yaml:"params" mapstructure:"params"` Collation string `yaml:"collation" mapstructure:"collation"` Loc *time.Location `yaml:"location" mapstructure:"loc"` TLSConfig string `yaml:"tlsConfig" mapstructure:"tlsConfig"` Timeout time.Duration `yaml:"timeout" mapstructure:"timeout"` ReadTimeout time.Duration `yaml:"readTimeout" mapstructure:"readTimeout"` WriteTimeout time.Duration `yaml:"writeTimeout" mapstructure:"writeTimeout"` AllowAllFiles bool `yaml:"allowAllFiles" mapstructure:"allowAllFiles"` AllowCleartextPasswords bool `yaml:"allowCleartextPasswords" mapstructure:"allowCleartextPasswords"` AllowOldPasswords bool `yaml:"allowOldPasswords" mapstructure:"allowOldPasswords"` ClientFoundRows bool `yaml:"clientFoundRows" mapstructure:"clientFoundRows"` ColumnsWithAlias bool `yaml:"columnsWithAlias" mapstructure:"columnsWithAlias"` InterpolateParams bool `yaml:"interpolateParams" mapstructure:"interpolateParams"` MultiStatements bool `yaml:"multiStatements" mapstructure:"multiStatements"` ParseTime bool `yaml:"parseTime" mapstructure:"parseTime"` GoogleAuthFile string `yaml:"googleAuthFile" mapstructure:"googleAuthFile"` }
MysqlConfig is settings of a MySQL server. It contains almost same fields as mysql.Config, but with some different field names and tags.
func (*MysqlConfig) FormatDSN ¶
func (m *MysqlConfig) FormatDSN() string
FormatDSN returns MySQL DSN from settings.
type RedisConfig ¶
type ServerConfig ¶
Click to show internal directories.
Click to hide internal directories.