grpc

package
v4.0.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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 HealthMonitor added in v4.0.1

type HealthMonitor interface {
	Monitor(string)
	Up() bool
}

HealthMonitor blocks a connection to a specific service health

func NewHealthChecker added in v4.0.1

func NewHealthChecker(c context.Context) HealthMonitor

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