grpc

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: GPL-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 of gRpc

func DefaultServer

func DefaultServer(opts ...ServerOption) *Server

DefaultServer 默认的grpc server入口

func NewServer

func NewServer(opts ...ServerOption) *Server

NewServer new server with options

func (*Server) GetListener

func (s *Server) GetListener() net.Listener

GetListener get servers listener

func (*Server) RegisterService

func (s *Server) RegisterService(desc *grpc.ServiceDesc, impl interface{})

RegisterService register gRpc service

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start gRpc server

func (*Server) Stop

func (s *Server) Stop() error

Stop gRpc server

type ServerOption

type ServerOption func(server *Server)

ServerOption gRpc server option

func GrpcAddress

func GrpcAddress(address string) ServerOption

Address gRpc server listen address

func GrpcListener

func GrpcListener(lis net.Listener) ServerOption

Listener listener

func GrpcOptions

func GrpcOptions(opts ...grpc.ServerOption) ServerOption

Options set gRpc server options

func StreamInterceptor

func StreamInterceptor(in ...grpc.StreamServerInterceptor) ServerOption

StreamInterceptor register stream interceptors

func UnaryInterceptor

func UnaryInterceptor(in ...grpc.UnaryServerInterceptor) ServerOption

UnaryInterceptor register unary interceptors

Jump to

Keyboard shortcuts

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