xfer

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProbePort is the default port that the probe(s) will listen on to
	// publish reports.
	ProbePort = 4030

	// AppPort is the default port that the app will use for its HTTP server.
	AppPort = 4040
)
View Source
var (
	// MaxBackoff is the maximum time between connect retries.
	// It's exported so it's externally configurable.
	MaxBackoff = 1 * time.Minute
)

Functions

This section is empty.

Types

type Collector

type Collector interface {
	Add(string)
	Remove(string)
	Reports() <-chan report.Report
	Stop()
}

Collector describes anything that can have addresses added and removed, and which produces reports that represent aggregate reports from all collected addresses.

func NewCollector

func NewCollector(batchTime time.Duration, id string) Collector

NewCollector produces and returns a report collector.

type HandshakeRequest added in v0.3.0

type HandshakeRequest struct {
	ID string
}

HandshakeRequest contains the unique ID of the connecting app.

type Publisher

type Publisher interface {
	Publish(report.Report)
	Close()
}

Publisher provides a way to send reports upstream.

type TCPPublisher

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

TCPPublisher is a Publisher implementation which uses TCP and gob encoding.

func NewTCPPublisher

func NewTCPPublisher(listenAddress string) (*TCPPublisher, error)

NewTCPPublisher listens for connections on listenAddress. Only one client is accepted at a time; other clients are accepted, but disconnected right away. Reports published via publish() will be written to the connected client, if any. Gentle shutdown of the returned publisher via close().

func (*TCPPublisher) Close

func (p *TCPPublisher) Close()

Close stops a TCPPublisher and closes the socket.

func (*TCPPublisher) Publish

func (p *TCPPublisher) Publish(msg report.Report)

Publish sens a Report to the client, if any.

Jump to

Keyboard shortcuts

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