grpc

package
v4.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const BalancerRoundRobin = "cells-robin-"

Variables

View Source
var (
	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, oo ...client.BalancerOption) 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
	Stop()
}

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
	BalancerFilter client.BalancerTargetFilter
}

Jump to

Keyboard shortcuts

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