grpcserver

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainStreamServer added in v1.0.0

func ChainStreamServer(interceptors ...grpc.StreamServerInterceptor) grpc.StreamServerInterceptor

ChainStreamServer creates a single interceptor out of a chain of many interceptors.

Copy from grpc-ecosystem/go-grpc-middleware.

Execution is done in left-to-right order, including passing of context. For example ChainUnaryServer(one, two, three) will execute one before two before three. If you want to pass context between interceptors, use WrapServerStream.

func ChainUnaryServer added in v1.0.0

func ChainUnaryServer(interceptors ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor

ChainUnaryServer creates a single interceptor out of a chain of many interceptors.

Copy from grpc-ecosystem/go-grpc-middleware.

Execution is done in left-to-right order, including passing of context. For example ChainUnaryServer(one, two, three) will execute one before two before three, and three will see context changes of one and two.

Types

type Config

type Config struct {
	Network    string `config:"network" desc:"The network must be \"tcp\", \"tcp4\", \"tcp6\", \"unix\" or \"unixpacket\""`
	Addr       string `config:"addr" desc:"format: host:port"`
	Reflection bool   `config:"reflection" desc:"Enable server reflection service"`
	// contains filtered or unexported fields
}

func DefaultConfig added in v1.0.0

func DefaultConfig(key string) *Config

func StdConfig added in v1.0.0

func StdConfig(key string, optionFunc ...OptionFunc) *Config

func (*Config) Build added in v1.0.0

func (c *Config) Build() *Server

func (*Config) Path added in v1.0.0

func (c *Config) Path() string

type OptionFunc

type OptionFunc func(*Config)

func WithServerOption

func WithServerOption(opt ...grpc.ServerOption) OptionFunc

func WithStreamServerInterceptor added in v1.0.0

func WithStreamServerInterceptor(interceptor ...grpc.StreamServerInterceptor) OptionFunc

func WithUnaryServerInterceptor added in v1.0.0

func WithUnaryServerInterceptor(interceptor ...grpc.UnaryServerInterceptor) OptionFunc

func WithWrap added in v1.0.0

func WithWrap(wrap Wrap) OptionFunc

type Server

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

func (*Server) Name

func (server *Server) Name() string

func (*Server) Serve

func (server *Server) Serve(ctx context.Context) error

func (*Server) Shutdown

func (server *Server) Shutdown(ctx context.Context) error

type Wrap added in v1.0.0

type Wrap func(*grpc.Server)

Directories

Path Synopsis
interceptor

Jump to

Keyboard shortcuts

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