iedc-go/var.go

71 lines
3.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package hotime
var IsRun = false //当前状态
var App = map[string]*Application{} //整个项目
//var Db = HoTimeDB{} //数据库实例
var Config = Map{
"debug": 1, //debug 0关闭1开启
"logLevel": LOG_NIL,
"dbHost": "127.0.0.1",
//"dbHost":"localhost",
"dbName": "test",
"dbUser": "root",
"dbPwd": "root",
"dbPort": "3306",
"dbCached": 0, //0不开启缓存
"cacheShortTime": 60 * 60 * 2,
"cacheLongTime": 60 * 60 * 24 * 30,
"error": Map{
"1": "内部系统异常",
"2": "访问权限异常",
"3": "请求参数异常",
"4": "数据处理异常",
"5": "数据结果异常",
},
"tpt": "tpt",
"defFile": []string{"index.html", "index.htm"},
"crossDomain": "", //是否开启跨域
"modeRouterStrict": false, //路由严格模式/a/b/c
"port": "0",
"sessionName": "HOTIME",
"tlsPort": "0",
"tlsKey": "",
"tlsCert": "",
}
var ConfigNote = Map{
"logLevel": "日志等级0打印1关闭2记录到文件",
"debug": "是否开启debug模式0关闭其他开启debug模式下日志展示更全", //debug 0关闭1开启
"dbHost": "数据库ip地址默认127.0.0.1",
"dbName": "数据库名称sqlite为文件路径比如a/x.db",
"dbUser": "数据库用户名",
"dbPwd": "数据库密码",
"dbPort": "数据库端口",
"dbType": "如果使用自动数据库配置请设置此项手动配置数据库不需要目前支持mysqlsqlite",
"dbCached": "是否开启数据库缓存0为关闭其他开启", //0不开启缓存
"redisHost": "需要使用redis服务时配置默认服务ip127.0.0.1",
"redisPort": "需要使用redis服务时配置默认服务端口6379",
"redisPwd": "需要使用redis服务时配置默认服务密码123456",
"cacheShortTime": "两级缓存短缓存存储时间60 * 60 * 2一般为内存缓存",
"cacheLongTime": "两级缓存长缓存存储时间60 * 60 * 24 * 30一般为数据库或者redis缓存",
"error": Map{
"1": "内部系统异常,在环境配置,文件访问权限等基础运行环境条件不足造成严重错误时使用",
"2": "访问权限异常,没有登录或者登录异常等时候使用",
"3": "请求参数异常request参数不满足要求比如参数不足参数类型错误参数不满足要求等时候使用",
"4": "数据处理异常,数据库操作或者三方请求返回的结果非正常结果,比如数据库突然中断等时候使用",
"5": "数据结果异常一般用于无法给出response要求的格式要求下使用比如response需要的是string格式但你只能提供int数据时",
"注释": "web服务内置错误提示自定义异常建议10开始",
},
"tpt": "静态文件目录默认为程序目录下tpt目录",
"defFile": "默认访问文件默认访问index.html或者index.htm文件",
"crossDomain": "跨域设置,空字符串为不开启,*为开启所有网站允许跨域http://www.baidu.com为指定域允许跨域", //是否开启跨域
"modeRouterStrict": "路由严格模式false,为大小写忽略必须匹配true必须大小写匹配", //路由严格模式/a/b/c
"sessionName": "设置session的cookie名默认HOTIME",
"port": "web服务开启Http端口0为不启用http服务",
"tlsPort": "web服务https端口0为不启用https服务",
"tlsKey": "https密钥",
"tlsCert": "https证书",
}