Documentation ¶
Index ¶
- func NewClient(address string) (conn *grpc.ClientConn, err error)
- func NewTLSClient(address string, cert *tls.Certificate) (conn *grpc.ClientConn, err error)
- type GRPCServerInterface
- type Server
- func (server *Server) RegisterService(register func(s grpc.ServiceRegistrar)) *Server
- func (server *Server) Run(stop <-chan struct{})
- func (server *Server) Shutdown()
- func (server *Server) WithChainUnaryInterceptor(interceptors ...grpc.UnaryServerInterceptor) *Server
- func (server *Server) WithKeepAliveParams(kp keepalive.ServerParameters) *Server
- func (server *Server) WithOptions(opts ...grpc.ServerOption) *Server
- func (server *Server) WithTLSConfig(cert *tls.Certificate) *Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶ added in v1.1.4
func NewClient(address string) (conn *grpc.ClientConn, err error)
NewClient returns a new client of grpc.
func NewTLSClient ¶ added in v1.1.9
func NewTLSClient(address string, cert *tls.Certificate) (conn *grpc.ClientConn, err error)
NewTLSClient creates a new TLS client for grpc connection
Types ¶
type GRPCServerInterface ¶ added in v1.1.9
type GRPCServerInterface interface { grpc.ServiceRegistrar GracefulStop() Serve(lis net.Listener) error }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a gRPC server.
func (*Server) RegisterService ¶
func (server *Server) RegisterService(register func(s grpc.ServiceRegistrar)) *Server
RegisterService registers grpc service
func (*Server) Run ¶ added in v1.1.9
func (server *Server) Run(stop <-chan struct{})
Run start grpc listener
func (*Server) WithChainUnaryInterceptor ¶
func (server *Server) WithChainUnaryInterceptor(interceptors ...grpc.UnaryServerInterceptor) *Server
WithChainUnaryInterceptor sets the interceptors.It must be called before RegisterService.
func (*Server) WithKeepAliveParams ¶
func (server *Server) WithKeepAliveParams(kp keepalive.ServerParameters) *Server
WithKeepAliveParams sets the KeepAlive option.It must be called before RegisterService.
func (*Server) WithOptions ¶
func (server *Server) WithOptions(opts ...grpc.ServerOption) *Server
WithOptions sets the options for the RPC server.It must be called before RegisterService.
func (*Server) WithTLSConfig ¶ added in v1.1.9
func (server *Server) WithTLSConfig(cert *tls.Certificate) *Server
WithTLSConfig set the TLS configuration
Click to show internal directories.
Click to hide internal directories.