v2

package
v0.0.0-...-14308cf Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 13 Imported by: 1

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 loggregator_v2.Ingress_BatchSenderClient, 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(msgs []*loggregator_v2.Envelope) error

type Conn

type Conn interface {
	Write(data []*loggregator_v2.Envelope) (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(envelopes []*loggregator_v2.Envelope) error

type Connector

type Connector interface {
	Connect() (io.Closer, loggregator_v2.Ingress_BatchSenderClient, error)
}

type GRPCConnector

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

func MakeGRPCConnector

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

func (GRPCConnector) Connect

type MetricClient

type MetricClient interface {
	NewGauge(name string, opts ...metrics.MetricOption) metrics.Gauge
}

type SenderFetcher

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

func NewSenderFetcher

func NewSenderFetcher(mc MetricClient, opts ...grpc.DialOption) *SenderFetcher

func (*SenderFetcher) Fetch

Jump to

Keyboard shortcuts

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