grpc

package
v0.0.0-...-f61a1b2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: Apache-2.0 Imports: 20 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)

Option set options

func WithAddr

func WithAddr(s string) Option

WithAddr set AddrOption

func WithContext

func WithContext(c context.Context) Option

WithContext set ContextOption

func WithDomain

func WithDomain(s string) Option

WithDomain set DomainOption

func WithID

func WithID(s string) Option

WithID set IDOption

func WithKeepAlive

func WithKeepAlive(t time.Duration) Option

WithKeepAlive set KeepAliveOption

func WithMaxConcurrentStreamsOption

func WithMaxConcurrentStreamsOption(i int) Option

WithMaxConcurrentStreamsOption set MaxConcurrentStreamsOption

func WithMaxConnectionAge

func WithMaxConnectionAge(t time.Duration) Option

WithMaxConnectionAge set MaxConnectionAgeOption

func WithMaxConnectionAgeGrace

func WithMaxConnectionAgeGrace(t time.Duration) Option

WithMaxConnectionAgeGrace set MaxConnectionAgeGraceOption

func WithMaxMsgSizeOption

func WithMaxMsgSizeOption(i int) Option

WithMaxMsgSizeOption set MaxMsgSizeOption

func WithStreamServerInterceptors

func WithStreamServerInterceptors(u ...grpc.StreamServerInterceptor) Option

WithStreamServerInterceptors set StreamServerInterceptorsOption

func WithTLS

func WithTLS(tls *tls.Config) Option

WithTLS set TlsOption

func WithTimeout

func WithTimeout(t time.Duration) Option

WithTimeout set TimeoutOption

func WithUnaryServerInterceptors

func WithUnaryServerInterceptors(u ...grpc.UnaryServerInterceptor) Option

WithUnaryServerInterceptors set UnaryServerInterceptorsOption

type Options

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

Options options

type Server

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

Server server

func New

func New(name string, options ...Option) *Server

New new grpc server

func (*Server) NewServer

func (e *Server) NewServer()

NewServer new a server

func (*Server) Options

func (e *Server) Options(options ...Option)

Options set options

func (*Server) Register

func (e *Server) Register(do func(server *Server))

Register register

func (*Server) Server

func (e *Server) Server() *grpc.Server

Server return server

func (*Server) Shutdown

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

Shutdown shutdown

func (*Server) Start

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

Start start

func (*Server) String

func (e *Server) String() string

String string

type Service

type Service struct {
	Connection  *grpc.ClientConn
	CallTimeout time.Duration
}

Service service client

func (*Service) Dial

func (e *Service) Dial(
	endpoint string,
	callTimeout time.Duration,
	unary ...grpc.UnaryClientInterceptor) (err error)

Dial dial

Directories

Path Synopsis
interceptors

Jump to

Keyboard shortcuts

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