ingress

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2018 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

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

Buffer is a simple wrapper around the go-diode for the events.Envelope type.

func NewBuffer

func NewBuffer(size int) *Buffer

NewBuffer initializes and returns with given size.

func (*Buffer) Alert

func (d *Buffer) Alert(missed int)

Alert is used by the internal diode. When envelopes are dropped we simply log a message noting how many envelopes were dropped.

func (*Buffer) Next

func (d *Buffer) Next() *events.Envelope

Next reads and returns the next envelope. This method will block until an envelope is available.

func (*Buffer) Set

func (d *Buffer) Set(e *events.Envelope)

Set adds an envelope to the buffer.

func (*Buffer) TryNext

func (d *Buffer) TryNext() (*events.Envelope, bool)

TryNext reads and returns the next envelope. This method will not block, if there is no envelope to read it will return nil for the envelope and a boolean of false.

type Inc

type Inc func(string)

Inc is a func that updates a counter for a given ID

type Ingestor

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

Ingestor will read envelopes off of a channel and write them to a given buffer.

func NewIngestor

func NewIngestor(msgs <-chan *events.Envelope, s Set) *Ingestor

NewIngestor returns an initialized Ingestor.

func (*Ingestor) Run

func (i *Ingestor) Run()

Run will start ingesting enveloeps off of the Ingestors message channel and writing them to the setter func. This method will block until the messages channel is closed.

type Next

type Next func() *events.Envelope

Next is a func that reads an envelope off of a buffer.

type Processor

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

Processor will read data from the Diode and update values in the store

func NewProcessor

func NewProcessor(n Next, i Inc, includeRouterLogs bool) *Processor

NewProcessor initializes a new Processor.

func (*Processor) Run

func (p *Processor) Run()

Run will read events.Envelopes from the processors next func and increment the counter for the Envelopes source instance. This is a blocking method that will run indefinitely.

type Set

type Set func(*events.Envelope)

Set is a func used by the Ingestor to write envelopes to.

Jump to

Keyboard shortcuts

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