Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 )
var ( // MaxBackoff is the maximum time between connect retries. MaxBackoff = 2 * time.Minute // externally configurable. )
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector connects to probes over TCP and merges reports published by those probes into a single one.
func NewCollector ¶
NewCollector starts the report collector.
func (*Collector) AddAddress ¶
AddAddress adds the passed IP to the collector, and starts (trying to) collect reports from the remote Publisher.
func (*Collector) AddAddresses ¶
AddAddresses adds the passed IPs to the collector, and starts (trying to) collect reports from the remote Publisher.
func (*Collector) RemoveAddress ¶
RemoveAddress removes the passed IP from the collector, and stops collecting reports from the remote Publisher.
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.