Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientOptions = []grpc.DialOption{ grpc.WithInsecure(), grpc.WithKeepaliveParams(keepalive.ClientParameters{ Time: 30 * time.Second, Timeout: 10 * time.Second, PermitWithoutStream: true, }), }
Functions ¶
Types ¶
type GrpcServer ¶
type GrpcServer struct { ServiceName string Port int Opts []grpc.ServerOption }
GrpcServer is a grpc server.
func NewGrpcServer ¶
func NewGrpcServer(serviceName string, port int, opts ...grpc.ServerOption) *GrpcServer
NewGrpcServer creates a new grpc server with serviceName, port and opts.
func (*GrpcServer) Serve ¶
func (g *GrpcServer) Serve(ctx context.Context, callback RegisterCallBack)
Serve start a grpc server and panic when failed.
type RegisterCallBack ¶
RegisterCallBack registers service for grpc server.
Click to show internal directories.
Click to hide internal directories.