nezha/cmd/dashboard/rpc/rpc.go

27 lines
476 B
Go
Raw Normal View History

2019-12-08 03:59:58 -05:00
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{
2019-12-09 03:02:49 -05:00
ClientID: "naiba",
ClientSecret: "123456",
2019-12-08 03:59:58 -05:00
},
})
listen, err := net.Listen("tcp", ":5555")
if err != nil {
panic(err)
}
server.Serve(listen)
}