grpc

package
v5.0.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: AGPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EndpointKey = endpointKey{}

Functions

func HandlerStreamInterceptor

func HandlerStreamInterceptor(interceptors *[]grpc.StreamServerInterceptor) grpc.StreamServerInterceptor

func HandlerUnaryInterceptor

func HandlerUnaryInterceptor(interceptors *[]grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor

func New

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

New creates the generic grpc.Server

Types

type Handler

type Handler struct{}

type IServer

type IServer interface {
	RegisterService(sd *grpc.ServiceDesc, ss any)
	GetServiceInfo() map[string]grpc.ServiceInfo
	Serve(lis net.Listener) error
	Stop()
	GracefulStop()
}

type Opener

type Opener struct {
}

func (*Opener) OpenURL

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

type Option

type Option func(*Options)

func WithAddr

func WithAddr(addr string) Option

func WithAuth

func WithAuth() Option

func WithListener

func WithListener(lis net.Listener) Option

func WithName

func WithName(name string) Option

func WithScheme

func WithScheme(scheme string) Option

func WithSecure

func WithSecure() Option

type Options

type Options struct {
	Scheme   string
	Name     string
	Addr     string
	JwtAuth  bool
	Secure   bool
	Listener net.Listener
}

type Server

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

func (*Server) As

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

func (*Server) Clone

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

func (*Server) ID

func (s *Server) ID() string

func (*Server) Metadata

func (s *Server) Metadata() map[string]string

func (*Server) Name

func (s *Server) Name() string

func (*Server) RawServe

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