v1

package
v0.0.0-...-17888d6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2018 License: Apache-2.0, BSD-3-Clause, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithLookup

func WithLookup(lookup func(string) ([]net.IP, error)) func(*Balancer)

WithLookup sets the behavior of looking up IPs

Types

type Balancer

type Balancer struct {
	// contains filtered or unexported fields
}

Balancer provides IPs resolved from a DNS address in random order

func NewBalancer

func NewBalancer(addr string, opts ...BalancerOption) *Balancer

NewBalancer returns a Balancer

func (*Balancer) NextHostPort

func (b *Balancer) NextHostPort() (string, error)

NextHostPort returns hostport resolved from the balancer's addr. It returns error for an invalid addr or if lookup failed or doesn't resolve to anything.

type BalancerOption

type BalancerOption func(*Balancer)

BalancerOption is a type that will manipulate a config

type ClientFetcher

type ClientFetcher interface {
	Fetch(addr string) (conn io.Closer, client plumbing.DopplerIngestor_PusherClient, err error)
}

type ClientPool

type ClientPool struct {
	// contains filtered or unexported fields
}

func New

func New(conns ...Conn) *ClientPool

func (*ClientPool) Write

func (c *ClientPool) Write(msg []byte) error

type Conn

type Conn interface {
	Write(data []byte) (err error)
}

type ConnManager

type ConnManager struct {
	// contains filtered or unexported fields
}

func NewConnManager

func NewConnManager(c Connector, maxWrites int64, pollDuration time.Duration) *ConnManager

func (*ConnManager) Write

func (m *ConnManager) Write(data []byte) error

type Connector

type Connector interface {
	Connect() (io.Closer, plumbing.DopplerIngestor_PusherClient, error)
}

type GRPCConnector

type GRPCConnector struct {
	// contains filtered or unexported fields
}

func MakeGRPCConnector

func MakeGRPCConnector(fetcher ClientFetcher, balancers []*Balancer) GRPCConnector

func (GRPCConnector) Connect

type HealthRegistrar

type HealthRegistrar interface {
	Inc(name string)
	Dec(name string)
}

type PusherFetcher

type PusherFetcher struct {
	// contains filtered or unexported fields
}

func NewPusherFetcher

func NewPusherFetcher(r HealthRegistrar, opts ...grpc.DialOption) *PusherFetcher

func (*PusherFetcher) Fetch

Jump to

Keyboard shortcuts

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