grpcext

package
v1.3.16 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Platform = "gRPC"
)

Variables

This section is empty.

Functions

func Serve

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

func StreamToServerOption

func StreamToServerOption(mdl ...grpc.StreamServerInterceptor) grpc.ServerOption

func UnaryToServerOption

func UnaryToServerOption(mdl ...grpc.UnaryServerInterceptor) grpc.ServerOption

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