grpc

package
v0.0.0-...-04c4af4 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func WithAuthFunc

func WithAuthFunc(f auth.AuthFunc) Option

func WithDefaultAuthFunc

func WithDefaultAuthFunc() Option

func WithDefaultInterceptorLogger

func WithDefaultInterceptorLogger() Option

func WithDefaultRecoveryHandlerFunc

func WithDefaultRecoveryHandlerFunc() Option

func WithEnableHealth

func WithEnableHealth() Option

func WithIgnoreProtoValidateMessages

func WithIgnoreProtoValidateMessages(msgs ...protoreflect.MessageType) Option

func WithInterceptorLogger

func WithInterceptorLogger(f logging.LoggerFunc) Option

func WithPort

func WithPort(port int) Option

func WithRecoveryHandlerFunc

func WithRecoveryHandlerFunc(f recovery.RecoveryHandlerFunc) Option

func WithStreamInterceptors

func WithStreamInterceptors(interceptors ...grpc.StreamServerInterceptor) Option

func WithUnaryInterceptors

func WithUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor) Option

type Options

type Options struct {
	Port                        int
	EnableHealth                bool
	RecoveryHandlerFunc         recovery.RecoveryHandlerFunc
	InterceptorLogger           logging.LoggerFunc
	AuthFunc                    auth.AuthFunc
	IgnoreProtoValidateMessages []protoreflect.MessageType
	UnaryInterceptors           []grpc.UnaryServerInterceptor
	StreamInterceptors          []grpc.StreamServerInterceptor
}

func (*Options) MergeIn

func (o *Options) MergeIn(opts ...Option)

type Server

type Server struct {
	providers.AbstractRunProvider

	Opts     *Options
	Server   *grpc.Server
	Listener net.Listener
}

func New

func New(opts ...Option) *Server

func (*Server) Close

func (p *Server) Close() error

func (*Server) Init

func (p *Server) Init() error

func (*Server) Run

func (p *Server) Run() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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