grpc

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CallTimeoutDefault = 10 * time.Minute
	CallTimeoutShort   = 1 * time.Second
)

Functions

func DialOptionsForRegistry

func DialOptionsForRegistry(reg registry.Registry, options ...grpc.DialOption) []grpc.DialOption

func GetClientConnFromCtx

func GetClientConnFromCtx(ctx context.Context, serviceName string, opt ...Option) grpc.ClientConnInterface

func MetaStreamClientInterceptor

func MetaStreamClientInterceptor() grpc.StreamClientInterceptor

func MetaUnaryClientInterceptor

func MetaUnaryClientInterceptor() grpc.UnaryClientInterceptor

func NewBuilder

func NewBuilder(reg registry.Registry) resolver.Builder

func NewClientConn

func NewClientConn(serviceName string, opt ...Option) grpc.ClientConnInterface

NewClientConn returns a client attached to the defaults.

func RegisterMock

func RegisterMock(serviceName string, mock grpc.ClientConnInterface)

RegisterMock registers a stubbed ClientConnInterface for a given service

Types

type Option

type Option func(*Options)

func WithCallTimeout

func WithCallTimeout(c time.Duration) Option

func WithClientConn

func WithClientConn(c grpc.ClientConnInterface) Option

func WithDialOptions

func WithDialOptions(opts ...grpc.DialOption) Option

func WithPeerSelector

func WithPeerSelector(host string) Option

func WithRegistry

func WithRegistry(r registry.Registry) Option

type Options

type Options struct {
	ClientConn      grpc.ClientConnInterface
	Registry        registry.Registry
	CallTimeout     time.Duration
	DialOptions     []grpc.DialOption
	SubConnSelector subConnInfoFilter
}

Jump to

Keyboard shortcuts

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