1 Star 0 Fork 0

firefly/chat-svc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
chat.go 770 Bytes
一键复制 编辑 原始数据 按行查看 历史
grail 提交于 2021-09-15 15:09 +08:00 . v2
package main
import (
"flag"
"fmt"
"gitee.com/fireflylove/chat-svc/internal/config"
"gitee.com/fireflylove/chat-svc/internal/server"
"gitee.com/fireflylove/chat-svc/internal/svc"
"gitee.com/fireflylove/chat-svc/template"
"github.com/tal-tech/go-zero/core/conf"
"github.com/tal-tech/go-zero/zrpc"
"google.golang.org/grpc"
)
var configFile = flag.String("f", "etc/chat.yaml", "the config file")
func main() {
flag.Parse()
var c config.Config
conf.MustLoad(*configFile, &c)
ctx := svc.NewServiceContext(c)
srv := server.NewChatServer(ctx)
s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
template.RegisterChatServer(grpcServer, srv)
})
defer s.Stop()
fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
s.Start()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/fireflylove/chat-svc.git
git@gitee.com:fireflylove/chat-svc.git
fireflylove
chat-svc
chat-svc
v1.0.1

搜索帮助