grpc

package
v4.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorFormatStreamInterceptor added in v4.0.7

func ErrorFormatStreamInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

func ErrorFormatUnaryInterceptor added in v4.0.7

func ErrorFormatUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

func New

func New(ctx context.Context, opt ...Option) server.Server

New creates the generic grpc.Server

func NewWithServer

func NewWithServer(ctx context.Context, name string, s *grpc.Server, listen string) server.Server

NewWithServer can pass preset grpc.Server with custom listen address

Types

type Handler added in v4.0.1

type Handler struct{}

func (*Handler) Check added in v4.0.1

func (*Handler) Watch added in v4.0.1

type Opener added in v4.0.1

type Opener struct{}

func (*Opener) OpenURL added in v4.0.1

func (o *Opener) OpenURL(ctx context.Context, u *url.URL) (server.Server, error)

type Option

type Option func(*Options)

func WithAddr added in v4.0.1

func WithAddr(addr string) Option

func WithListener

func WithListener(lis net.Listener) Option

func WithName added in v4.0.6

func WithName(name string) Option

type Options

type Options struct {
	Name     string
	Addr     string
	Listener net.Listener
}

type Server

type Server struct {
	*grpc.Server

	sync.Mutex
	// contains filtered or unexported fields
}

func (*Server) As

func (s *Server) As(i interface{}) bool

func (*Server) Clone added in v4.2.2

func (s *Server) Clone() interface{}

func (*Server) ID

func (s *Server) ID() string

func (*Server) Name

func (s *Server) Name() string

func (*Server) RawServe added in v4.0.1

func (s *Server) RawServe(opts *server.ServeOptions) (ii []registry.Item, e error)

func (*Server) Stop

func (s *Server) Stop() error

func (*Server) Type

func (s *Server) Type() server.Type

Jump to

Keyboard shortcuts

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