Files
gf/example/registry/etcd/grpc/server/server.go

22 lines
561 B
Go
Raw Normal View History

2023-03-08 14:12:51 +08:00
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package main
import (
2023-03-17 17:51:10 +08:00
"github.com/gogf/gf/contrib/registry/etcd/v2"
2023-03-08 14:12:51 +08:00
"github.com/gogf/gf/contrib/rpc/grpcx/v2"
2023-03-17 17:51:10 +08:00
"github.com/gogf/gf/example/registry/etcd/grpc/controller"
2023-03-08 14:12:51 +08:00
)
func main() {
2023-03-17 17:51:10 +08:00
grpcx.Resolver.Register(etcd.New("127.0.0.1:2379"))
2023-03-08 14:12:51 +08:00
s := grpcx.Server.New()
2023-03-17 17:51:10 +08:00
controller.Register(s)
2023-03-08 14:12:51 +08:00
s.Run()
}