grpcext

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Platform = "gRPC"
)

Variables

This section is empty.

Functions

func DIUnaryInterceptor

func DIUnaryInterceptor[T any](key string, provide func() T) grpc.UnaryServerInterceptor

func Serve

func Serve(configs Configs, services []ServiceRegister, options []grpc.ServerOption)

func UnaryContextMetadataInterceptor

func UnaryContextMetadataInterceptor() grpc.UnaryServerInterceptor

func UnaryWrapErrorInterceptor

func UnaryWrapErrorInterceptor() grpc.UnaryServerInterceptor

Types

type Configs

type Configs struct {
	GrpcPort netext.Port `env:"GRPC_PORT" envDefault:"6565"`
}

type Connection

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

func NewConnection

func NewConnection(target string) *Connection

func NewInternalConnection

func NewInternalConnection(configs Configs) *Connection

func (*Connection) Invoke

func (c *Connection) Invoke(ctx context.Context, method string, args any, reply any, opts ...grpc.CallOption) error

func (*Connection) NewStream

func (c *Connection) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)

type ServiceRegister

type ServiceRegister interface {
	RegisterService(server *grpc.Server)
}

Jump to

Keyboard shortcuts

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