Documentation ¶
Index ¶
Constants ¶
View Source
const ( PathRoot = "/" PathBackend = "/admin" PathAPI = "/api" PathArticle = "/article" PathCategory = "/category" PathTag = "/tag" PathSubject = "/subject" PathArchives = "/archives" PathRSS = "/rss" PathSiteMap = "/sitemap.xml" PathRobots = "/robots.txt" PathFavicon = "/favicon.ico" )
router path config
View Source
const ( StaticPathRoot = "" StaticPathTheme = "theme" )
static path config
View Source
const ( // UploadPath defines the media file save path uri UploadPath = "/uploads/" // savePath defines the use avatar saving path UploadUserAvatarPath = "/uploads/users/" )
upload path config
Variables ¶
View Source
var ( Server *ServerConfig Safety *SafetyConfig Log *LogConfig Db *DbConfig )
Functions ¶
func InitConfig ¶
NewConfig set up viper config and return a Config struct instance
func StaticPath ¶
StaticPath change path to static path base on the StaticPathRoot
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config instance struct of config
type DbConfig ¶
type DbConfig struct { DbType string `mapstructure:"db_type"` Name string `mapstructure:"name"` Addr string `mapstructure:"addr"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` MaxIdleConns int `mapstructure:"max_idle_conns"` MaxOpenConns int `mapstructure:"max_open_conns"` }
type SafetyConfig ¶
type SafetyConfig struct {
JwtSecret string `mapstructure:"jwt_secret"`
}
type ServerConfig ¶
type ServerConfig struct { Runmode string `mapstructure:"runmode"` Name string `mapstructure:"name"` HttpPort string `mapstructure:"http_port"` HttpsOpen bool `mapstructure:"https_open"` HttpsPort string `mapstructure:"https_port"` TlsCert string `mapstructure:"tls_cert"` TlsKey string `mapstructure:"tls_key"` PingUrl string `mapstructure:"ping_url"` PingMaxNum int `mapstructure:"ping_max_num"` }
Click to show internal directories.
Click to hide internal directories.