generated from pkg/go-template
25 lines
681 B
Go
25 lines
681 B
Go
package servesr
|
|
|
|
import (
|
|
"fmt"
|
|
"git.icechen.cn/monorepo/backend/pkg/proto/brahma/murders"
|
|
"git.icechen.cn/monorepo/backend/pkg/rpc"
|
|
ctxLogger "github.com/luizsuper/ctxLoggers"
|
|
"go.uber.org/zap"
|
|
"google.golang.org/grpc"
|
|
"net"
|
|
)
|
|
|
|
func RpcServer() {
|
|
lis, err := net.Listen("tcp", ":3001")
|
|
if err != nil {
|
|
ctxLogger.Info(nil, "brahma server start up error", zap.String("error", err.Error()))
|
|
}
|
|
s := grpc.NewServer(grpc.UnaryInterceptor(rpc.Interceptor))
|
|
murders.RegisterMurdersServer(s, &Script{})
|
|
fmt.Println("lark server run in :3000")
|
|
if err := s.Serve(lis); err != nil {
|
|
ctxLogger.Info(nil, "brahma server start up error", zap.String("error", err.Error()))
|
|
}
|
|
}
|