Documentation ¶
Index ¶
- Constants
- Variables
- func NewBuilder(reg registry.Registry, oo ...client.BalancerOption) resolver.Builder
- func RegisterMock(serviceName string, mock grpc.ClientConnInterface)
- func RegisterServiceTransformer(transformer ServiceTransformer)
- func ResolveConn(ctx context.Context, serviceName string, opt ...Option) grpc.ClientConnInterface
- type HealthMonitor
- type Option
- type Options
- type ServiceTransformer
Constants ¶
View Source
const BalancerRoundRobin = "cells-robin-"
Variables ¶
View Source
var (
CallTimeoutShort = 1 * time.Second
)
Functions ¶
func NewBuilder ¶
func RegisterMock ¶
func RegisterMock(serviceName string, mock grpc.ClientConnInterface)
RegisterMock registers a stubbed ClientConnInterface for a given service
func RegisterServiceTransformer ¶
func RegisterServiceTransformer(transformer ServiceTransformer)
func ResolveConn ¶
Types ¶
type HealthMonitor ¶
HealthMonitor blocks a connection to a specific service health
func NewHealthChecker ¶
func NewHealthChecker(c context.Context) HealthMonitor
NewHealthChecker creates a HealthMonitor that blocks once on establishing the gRPC connection
func NewHealthCheckerWithRetries ¶
func NewHealthCheckerWithRetries(c context.Context, retry, timeout time.Duration) HealthMonitor
NewHealthCheckerWithRetries creates a HealthMonitor that retries the gRPC connection if it fails Do not pass 0 as retry or timeout parameters !
type Option ¶
type Option func(*Options)
func WithCallTimeout ¶
func WithClientConn ¶
func WithClientConn(c grpc.ClientConnInterface) Option
func WithDialOptions ¶
func WithDialOptions(opts ...grpc.DialOption) Option
func WithPeerSelector ¶
func WithRegistry ¶
func WithSilentNotFound ¶
func WithSilentNotFound() Option
type Options ¶
type Options struct { ClientConn grpc.ClientConnInterface Registry registry.Registry CallTimeout time.Duration DialOptions []grpc.DialOption BalancerFilter client.BalancerTargetFilter SilentNotFound bool }
Click to show internal directories.
Click to hide internal directories.