2 Star 0 Fork 53

admpub/smscode

forked from xluohome/smscode 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
xluo 提交于 2017-04-22 22:46 . 修复重构时遗漏的bug
package main
import (
"flag"
"fmt"
"os"
"runtime"
"time"
)
var (
config Config
configFile = flag.String("c", "conf/conf.yaml", "配置文件")
dbPath = flag.String("db", "level.db", "数据库保存路径")
smsworks = flag.Int("sw", runtime.NumCPU(), "短信验证码服务器数量")
callbackworkers = flag.Int("cw", runtime.NumCPU(), "Callback并发数")
trycallnums = flag.Uint("cn", 10, "Callback失败重试次数")
)
func init() {
flag.Usage = func() {
fmt.Printf("Usage %s -c=conf/conf.yaml -db level.db -sw 10 -cw 10 -cn 10", os.Args[0])
flag.PrintDefaults()
}
flag.Parse()
if err := config.ParseConfigFile(*configFile); err != nil {
fmt.Printf("%s\n%s", "Unable to load config info!", err)
os.Exit(1)
}
time.Local = func() *time.Location {
loc, err := time.LoadLocation(config.Timezone)
if err != nil {
loc = time.UTC
}
return loc
}()
RunCallbackTask()
}
func main() {
smscodetxt := `
**
*
*
***** ******* ***** *** **** ***** ****
* * * * * * * * * * * * * * *
* * * * * * * * * * * *
**** * * * **** * * * * * ******
* * * * * * * * * * *
* * * * * * * * * * * * ** * *
***** *** ** ******* *** **** *** ** ****
https://github.com/xluohome/smscode ©xluo(phposs@qq.com)
`
fmt.Print(smscodetxt)
fmt.Printf("Smscode Server v%s ... TimeZone:%s \n\n", VERSION, config.Timezone)
Apiserver()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/admpub/smscode.git
git@gitee.com:admpub/smscode.git
admpub
smscode
smscode
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385