Documentation
¶
Index ¶
Constants ¶
View Source
const ( ProjectName = "meeseeks" RequestHeaderJWTKey = "Authorization" RequestHeaderRefershKey = "Authenticate" RequestHeaderJWTExpireTime = 60 * 60 * 2 RequestOpenAPIHeaderAppID = "Authorization-Appid" RequestOpenAPIHeaderSign = "Authorization-Sign" RequestOpenAPIHeaderTimestamp = "Authorization-Timestamp" RequestOpenAPIHeaderNone = "Authorization-None" )
View Source
const ( Debug int8 = iota - 1 Info Warn )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Server Server `mapstructure:"server"` RCache RCache `mapstructure:"rcache"` Database Database `mapstructure:"database"` Log Log `mapstructure:"log"` Jwt Jwt `mapstructure:"jwt"` WebHook struct { Feishu Feishu `mapstructure:"feishu"` } `mapstructure:"webhook"` // contains filtered or unexported fields }
func InitConfig ¶
func (*Config) GetDatabase ¶
type Database ¶
type Database struct { // 数据库驱动 Driver string `mapstructure:"driver"` // 数据库连接 Source string `mapstructure:"source"` // 数据库最大空闲连接数 // 数据库最大打开连接数 MaxOpenConn int `mapstructure:"max_open_conn"` MaxIdleConn int `mapstructure:"max_idle_conn"` MaxLifetime int `mapstructure:"max_life_time"` Mode int `mapstructure:"mode"` Charset string `mapstructure:"charset"` LogPath string `mapstructure:"log_path"` }
type Server ¶
type Server struct { // server debug mode (default: true) Debug bool `mapstructure:"debug"` // server address to listen (default: 0.0.0.0) Addr string `mapstructure:"addr"` // server port (default: 80) Port int `mapstructure:"port"` // server max connection (default: 1000) MaxConn int `mapstructure:"max_conn"` // server read timeout (default: 60) ReadTimeout int `mapstructure:"read_timeout"` // server log path (default: ./log/server.log) LogPath string `mapstructure:"log_path"` // server cors config CorsAllowOrigins []string `mapstructure:"allow_origins"` }
Click to show internal directories.
Click to hide internal directories.