server

package
v0.0.0-...-2617f14 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 14 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultMaxMsgSize define maximum message size that server can send
	// or receive.  Default value is 4MB.
	DefaultMaxMsgSize = 1024 * 1024 * 4
)

Functions

func UnaryClient

func UnaryClient(interceptors ...grpc.UnaryClientInterceptor) grpc.DialOption

func UnaryServer

func UnaryServer(interceptors ...grpc.UnaryServerInterceptor) grpc.ServerOption

Types

type GrpcServer

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

func NewGrpcServer

func NewGrpcServer(options ...Option) *GrpcServer

func (*GrpcServer) Registry

func (g *GrpcServer) Registry(reg registry.Registry, serOpts ...registry.ServerOpt) error

func (*GrpcServer) RegistryStopFunc

func (g *GrpcServer) RegistryStopFunc(f func())

func (*GrpcServer) Run

func (g *GrpcServer) Run() error

func (*GrpcServer) Server

func (g *GrpcServer) Server() grpc.ServiceRegistrar

func (*GrpcServer) WatchSignal

func (g *GrpcServer) WatchSignal()

type Option

type Option func(*Options)

func WithCtx

func WithCtx(ctx context.Context) Option

func WithGrpcOpts

func WithGrpcOpts(option ...grpc.ServerOption) Option

func WithHdlrWrappers

func WithHdlrWrappers(wrapper ...grpc.UnaryServerInterceptor) Option

func WithListenAddr

func WithListenAddr(addr string) Option

func WithMode

func WithMode(mode string) Option

mode release,debug

func WithName

func WithName(name string) Option

func WithNamespace

func WithNamespace(namespace string) Option

type Options

type Options struct {
	Name           string
	ListenAddr     string
	Namespace      string
	Version        string
	Mode           string //debubg product
	Ctx            context.Context
	GrpcOpts       []grpc.ServerOption
	HandleWrappers []grpc.UnaryServerInterceptor
}

Jump to

Keyboard shortcuts

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