go-common/app/service/live/xanchor/server/grpc/server.go

18 lines
403 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package grpc
import (
v1pb "go-common/app/service/live/xanchor/api/grpc/v1"
"go-common/app/service/live/xanchor/service"
"go-common/library/net/rpc/warden"
)
// New new grpc server
func New(svc *service.Service) (wsvr *warden.Server, err error) {
wsvr = warden.NewServer(nil)
v1pb.RegisterXAnchorServer(wsvr.Server(), svc.V1Svc())
if wsvr, err = wsvr.Start(); err != nil {
return
}
return
}