grpc

package
v1.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents a gRPC server.

func NewServer

func NewServer(address string) *Server

NewServer returns a new instance of the Server.

func (*Server) RegisterService

func (server *Server) RegisterService(register func(s *grpc.Server)) *Server

RegisterService registers grpc service

func (*Server) Serve

func (server *Server) Serve(stop <-chan struct{})

Serve start grpc listener

func (*Server) Shutdown

func (server *Server) Shutdown()

Shutdown shuts down the server.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL