grpcconnector

package
v74.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2017 License: Apache-2.0, BSD-3-Clause, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DopplerPool

type DopplerPool interface {
	RegisterDoppler(addr string)
	Subscribe(dopplerAddr string, ctx context.Context, req *plumbing.SubscriptionRequest) (plumbing.Doppler_SubscribeClient, error)
	ContainerMetrics(dopplerAddr string, ctx context.Context, req *plumbing.ContainerMetricsRequest) (*plumbing.ContainerMetricsResponse, error)
	RecentLogs(dopplerAddr string, ctx context.Context, req *plumbing.RecentLogsRequest) (*plumbing.RecentLogsResponse, error)

	Close(dopplerAddr string)
}

DopplerPool creates a pool of doppler gRPC connections

type Finder

type Finder interface {
	Next() dopplerservice.Event
}

Finder yields events that tell us what dopplers are available.

type GRPCConnector

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

GRPCConnector establishes GRPC connections to dopplers and allows calls to Firehose, Stream, etc to be reduced down to a single Receiver.

func New

func New(bufferSize int, pool DopplerPool, f Finder, batcher MetaMetricBatcher) *GRPCConnector

New creates a new GRPCConnector.

func (*GRPCConnector) ContainerMetrics

func (c *GRPCConnector) ContainerMetrics(ctx context.Context, appID string) [][]byte

ContainerMetrics returns the current container metrics for an app ID.

func (*GRPCConnector) RecentLogs

func (c *GRPCConnector) RecentLogs(ctx context.Context, appID string) [][]byte

RecentLogs returns the current recent logs for an app ID.

func (*GRPCConnector) Subscribe

Subscribe returns a Receiver that yields all corresponding messages from Doppler

type MetaMetricBatcher

type MetaMetricBatcher interface {
	BatchCounter(name string) metricbatcher.BatchCounterChainer
	BatchAddCounter(name string, delta uint64)
}

type Pool

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

func NewPool

func NewPool(size int, tlsConf *tls.Config) *Pool

func (*Pool) Close

func (p *Pool) Close(dopplerAddr string)

func (*Pool) ContainerMetrics

func (p *Pool) ContainerMetrics(dopplerAddr string, ctx context.Context, req *plumbing.ContainerMetricsRequest) (*plumbing.ContainerMetricsResponse, error)

func (*Pool) RecentLogs

func (p *Pool) RecentLogs(dopplerAddr string, ctx context.Context, req *plumbing.RecentLogsRequest) (*plumbing.RecentLogsResponse, error)

func (*Pool) RegisterDoppler

func (p *Pool) RegisterDoppler(addr string)

func (*Pool) Subscribe

type Receiver

type Receiver interface {
	Recv() ([]byte, error)
}

Receiver yeilds messages from a pool of Dopplers.

Jump to

Keyboard shortcuts

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