Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config interface {
Server() *ServerOption
Redis() *RedisOptions
Mysql() *MysqlOptions
Mns() *MnsConfig
}
Config接口
type MnsConfig ¶
type MnsConfig struct {
Url string `json:"url"`
AccessKeyId string `json:"access_key_id"`
AccessKeySecret string `json:"access_key_secret"`
}
MnsConfig 阿里云MNS 配置项
type MysqlOptions ¶
type MysqlOptions struct {
// auto connect
AutoConnect bool
// database name
Name string
// host
Host string
// port, default 3306
Port int
// user, default root
User string
// password
Password string
// log mode
LogMode bool
// MaxIdleConnections, default 10
MaxIdleConnections int
// MaxOpenConnections, default 40
MaxOpenConnections int
}
MysqlOptions
type RedisOptions ¶
type RedisOptions struct {
// AutoConnect
AutoConnect bool
// host
Host string
// port, default 6379
Port int
// auth
Auth string
// pool size, default 100
PoolSize int
// max retries, default 3
MaxRetries int
// timeout, default 10 seconds
IdleTimeout time.Duration
}
RedisOptions redis配置
func (*RedisOptions) Options ¶
func (conf *RedisOptions) Options() *redis.Options
Options get redis options
Click to show internal directories.
Click to hide internal directories.