server

package
v0.0.0-...-e6d56dd Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Name = "grpc"
)

const

Variables

View Source
var (
	ErrGRPCSvcDescMissing = errors.New("must use server.WithRPCServiceDesc to set desc")
	ErrGRPCSvcType        = errors.New("must set *grpc.ServiceDesc")
)

err define

Functions

func New

New create grpc server

func Request2Invocation

func Request2Invocation(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo) *invocation.Invocation

Request2Invocation convert grpc protocol to invocation

Types

type Server

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

Server is grpc server holder

func (*Server) Register

func (s *Server) Register(schema interface{}, options ...server.RegisterOption) (string, error)

Register register grpc services

func (*Server) Start

func (s *Server) Start() error

Start launch the server

func (*Server) Stop

func (s *Server) Stop() error

Stop gracfully shutdown grpc server

func (*Server) String

func (s *Server) String() string

String return server name

Jump to

Keyboard shortcuts

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