7 Star 1 Fork 1

罗中天 / douyin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 936 Bytes
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"gitee.com/derrickball/douyin/app/video/dal"
"gitee.com/derrickball/douyin/app/video/kitex_gen/video_rpc/videoservice"
"gitee.com/derrickball/douyin/app/video/rpc"
"gitee.com/derrickball/douyin/pkg/config"
"github.com/cloudwego/kitex/pkg/rpcinfo"
"github.com/cloudwego/kitex/server"
etcd "github.com/kitex-contrib/registry-etcd"
"log"
"net"
)
func Init() {
config.LoadConfig()
dal.Init()
rpc.Init()
}
func main() {
Init()
r, err := etcd.NewEtcdRegistry([]string{config.Config.Address.Etcd})
if err != nil {
panic(err)
}
addr, err := net.ResolveTCPAddr("tcp", config.Config.Address.Video)
if err != nil {
panic(err)
}
svr := videoservice.NewServer(new(VideoServiceImpl),
server.WithServerBasicInfo(&rpcinfo.EndpointBasicInfo{ServiceName: config.Config.Service.Video}),
server.WithServiceAddr(addr),
server.WithRegistry(r),
)
err = svr.Run()
if err != nil {
log.Fatal(err)
}
}
1
https://gitee.com/derrickball/douyin.git
git@gitee.com:derrickball/douyin.git
derrickball
douyin
douyin
48d44dfe16fa

搜索帮助