Web 服务

This commit is contained in:
奶爸 committed 2019-12-08 16:59:58 +08:00
1 parent b76ea0b4d3
commit f2f840de4a
33 files changed
+1111 -20

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
package rpc
import (
"net"
"google.golang.org/grpc"
pb "github.com/p14yground/nezha/proto"
rpcService "github.com/p14yground/nezha/service/rpc"
)
// ServeRPC ...
func ServeRPC() {
server := grpc.NewServer()
pb.RegisterNezhaServiceServer(server, &rpcService.NezhaHandler{
Auth: &rpcService.AuthHandler{
AppKey: "naiba",
AppSecret: "123456",
},
})
listen, err := net.Listen("tcp", ":5555")
if err != nil {
panic(err)
}
server.Serve(listen)
}