4 Star 12 Fork 2

wlaier/iceberg
暂停

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 906 Bytes
一键复制 编辑 原始数据 按行查看 历史
quinn 提交于 2017-11-20 02:21 +08:00 . 修改依赖包路径问题
package main
import (
"flag"
"os"
"path/filepath"
hi "gitee.com/wlaier/iceberg/demo/s2/pb"
"gitee.com/wlaier/iceberg/frame/config"
)
var (
cfgFile = flag.String("config-path", "icetest_conf.json", "config file")
logLevel = flag.String("level", "debug", "log level")
logPath = flag.String("logPath", "", "log path")
)
func main() {
// 解析命令行参数
flag.Parse()
// 设置进程的当前目录为程序所在的路径
dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
os.Chdir(dir)
var baseCfg config.BaseCfg
var etcdCfg config.EtcdCfg
etcdCfg.EndPoints = []string{"http://127.0.0.1:2379"}
etcdCfg.User = "iceberg"
etcdCfg.Psw = "123456"
etcdCfg.Timeout = 3
var zipkinCfg config.ZipkinCfg
// zipkinCfg.EndPoints = "http://localhost:9411/api/v1/spans"
baseCfg.Etcd = etcdCfg
baseCfg.Zipkin = zipkinCfg
// 直接注册就行了
hi.RegisterHiServer(new(Hi), &baseCfg)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/wlaier/iceberg.git
git@gitee.com:wlaier/iceberg.git
wlaier
iceberg
iceberg
fa9b2653450d

搜索帮助