consumer

package
v0.0.0-...-df27b73 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2018 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ISO8601 contains a time.Parse reference timestamp for ISO 8601.
	ISO8601 = "2006-01-02T15:04:05-07:00"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer struct {
	Period time.Duration
	// contains filtered or unexported fields
}

Consumer implements periodic polling of the supplied nginx access log tailer, aggregation of response counts from the returned log lines, and reporting of the latter via the supplied exporter (e.g. to Stackdriver).

func NewConsumer

func NewConsumer(period time.Duration, tailer tailer.TailerT, exporter exporter.ExporterT) *Consumer

NewConsumer returns a Consumer polling the supplied tailer and reporting to the supplied exporter with the specified period.

func (*Consumer) Run

func (c *Consumer) Run() error

Run performs periodic polling and exporting. It will only return on error or if Stop is called.

func (*Consumer) Stop

func (c *Consumer) Stop()

Stop signals that polling should cease in Run and the latter should return (e.g. if Run is blocking in another goroutine).

Jump to

Keyboard shortcuts

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