grpc

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server wrapper the grpc server.

func NewServer

func NewServer(ctx context.Context, listenAddr string) *Server

NewServer creates a wrapped grpc server instance.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns listen address.

func (*Server) AppendGRPCInterceptors

func (s *Server) AppendGRPCInterceptors(opts ...grpc.ServerOption)

AppendGRPCInterceptors appending interceptors as grpc server options.

func (*Server) GracefulShutdown

func (s *Server) GracefulShutdown(ctx context.Context)

GracefulShutdown close the underlying grpc server gracefully.

func (*Server) GrpcServer

func (s *Server) GrpcServer() *grpc.Server

GrpcServer returns the underlying grpc server.

func (*Server) Serve

func (s *Server) Serve() error

Serve handles incoming grpc connections, it blocks util invoking Stop or GracefulStop method.

func (*Server) Stop

func (s *Server) Stop()

Stop close the underlying grpc server.

Jump to

Keyboard shortcuts

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