2019-12-05 09:36:58 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
|
|
|
|
"google.golang.org/grpc"
|
2019-12-05 10:42:20 -05:00
|
|
|
|
|
|
|
pb "github.com/p14yground/nezha/proto"
|
2019-12-07 05:14:40 -05:00
|
|
|
"github.com/p14yground/nezha/service/handler"
|
2019-12-05 09:36:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
server := grpc.NewServer()
|
2019-12-07 05:14:40 -05:00
|
|
|
pb.RegisterNezhaServiceServer(server, &handler.NezhaHandler{
|
|
|
|
Auth: &handler.AuthHandler{
|
|
|
|
AppKey: "naiba",
|
|
|
|
AppSecret: "123456",
|
|
|
|
},
|
|
|
|
})
|
2019-12-05 09:36:58 -05:00
|
|
|
|
|
|
|
lis, err := net.Listen("tcp", ":5555")
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
server.Serve(lis)
|
|
|
|
}
|