Documentation ¶
Index ¶
Constants ¶
View Source
const ( // StaticAssets 站点公共资产的根目录 images, css, js. StaticAssets = "./assets/" StaticPublic = "./public/" // Favicon 程序的图标路径 Favicon = "favicon.ico" // ViewsPath 模板路径 ViewsPath = "./views" //IndexPath 前台模板路径 MbIPath = "fronted" //AdminPath 后台模板路径 MbAPath = "backend" //PcPath PC模板路径 PcPath = "pc" //WapPath WAP模板路径 WapPath = "wap" //SysTimeform 时间 SysTimeform = "2006-01-02 15:04:05" //SysTimeformShort 时间 SysTimeformShort = "2006-01-02" CookieNameForSessionID = "mycookiesessionnameid" //密码干扰码 PassWordSalt = "lqlcn8waomao8hubula8" //AES-128。key长度:16, 24, 32 bytes 对应 AES-128, AES-192, AES-256 AesKey = "Hubula_Lang_qianLi_WaoMao" // SITE_ID //////////////////TYPE///////////////////// //站点配置ID SITE_ID = 10007 //站点配置ID ADMIN_ROLE = 420 //角色ID MEMBER_GROUP = 400 //用户组 //博客模块ID TYPE_ID = 10006 //博客模块ID //原创 ORIGINAL = 10003 //原创 //栏目 博客分类属性 栏目ID TYPE_CAT = 10001 //栏目 博客分类属性 栏目ID //文章 TYPE_ARTICLE = 0 //文章 //是否阅读 READ_FINISH = 10016 //已看 READ_NOW = 10015 //在看 READ_NOT = 10014 //未看 /////////////////////////////////////////// APP_CSDN = 10011 //csdn ////////// ADMIN_YES = 301 //后台 ADMIN_NO = 302 //前台 // MODULE_ID_WORK_OTHER = 10018 //技术之外文章 生活 MODULE_ID_WORK = 10019 //技术 // TYPE_FROM = 600 //表单标签 TYPE_INPUT_RADIO = 603 //单选框 TYPE_INPUT_TEXTAREA = 604 //多行文本框 // APP_API = 10023 //接口 )
Variables ¶
View Source
var (
//中国时区
SysTimeLocation, _ = time.LoadLocation("Asia/Chongqing")
// 请求日志记录
CustomLogger = logger.New(logger.Config{
Status: true,
IP: true,
Method: true,
Path: true,
Query: true,
MessageContextKeys: []string{"logger_message"},
MessageHeaderKeys: []string{"User-Agent"},
})
//http 或者 https
HttpOrHttps = TomlData().App.HttpOrHttps
//域名
DomainName = TomlData().Stage[TomlData().RunMode].DomainName
//首页
HomePage = HttpOrHttps + DomainName
HomePages = HttpOrHttps + DomainName + "/"
//开发阶段 默认用户
AdminOpen = TomlData().Stage[TomlData().RunMode].AdminLoad
GroupadminKey = TomlData().Stage[TomlData().RunMode].CantKey
GroupadminVal = TomlData().Stage[TomlData().RunMode].Cant
//是否需要启动全局计划任务服务
RunningCrontabService = false
Sess = sessions.New(sessions.Config{Cookie: CookieNameForSessionID})
//SignSecret ObjSalesign 签名密钥
SignSecret = []byte("0123456789abcdef")
//CookieSecret cookie中的加密验证密钥
CookieSecret = "hellolottery"
)
Functions ¶
func ReloadConfig ¶
func ReloadConfig()
Types ¶
type ConfigToml ¶
type ConfigToml struct { //全局信息 Title string //开发阶段 RunMode string App app Stage map[string]stage `toml:"stage"` DB map[string]db Redis map[string]redis Releases releases Company company Song []song }
func TomlData ¶
func TomlData() *ConfigToml
Click to show internal directories.
Click to hide internal directories.