5 Star 37 Fork 13

tianxia007 / aliyunDDns

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 983 Bytes
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"AliYunDDns/app/service/aliyunddns"
"AliYunDDns/app/service/cronService"
"AliYunDDns/app/service/dns_jobs"
"AliYunDDns/app/util"
_ "AliYunDDns/boot"
_ "AliYunDDns/router"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gsession"
"github.com/gogf/gf/util/gconv"
"github.com/golang/glog"
"time"
)
func main() {
s := g.Server()
s.SetServerRoot("./public")
s.SetSessionMaxAge(6 * time.Hour)
s.SetSessionStorage(gsession.NewStorageMemory())
s.Start()
initConfig()
initJobs()
autoDO()
g.Wait()
}
func initJobs() {
allToStartS := dns_jobs.AllToStart()
for _, v := range allToStartS {
cronService.AddCronJob(v.Cron, v.Domain)
}
glog.Info("从数据加载配置的任务完成.启动任务数量:" + gconv.String(len(allToStartS)) + "!")
}
func initConfig() {
aliyunddns.InitConfig()
}
func autoDO() {
//自动更新系统时间
go util.UpdateSystemDateAuto()
util.OpenUrl("http://localhost" + g.Cfg().GetString("server.Address"))
}
Go
1
https://gitee.com/dwxdfhx/aliyunDDns.git
git@gitee.com:dwxdfhx/aliyunDDns.git
dwxdfhx
aliyunDDns
aliyunDDns
master

搜索帮助