publisher

package
v0.0.0-...-c50d277 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeStdout  = "stdout"
	TypeDatadog = "datadog"
)

Set of possible publisher types.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	Collect() (map[string]interface{}, error)
}

Collector defines a contract a collector must support so a consumer can retrieve metrics.

type Publish

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

Publish provides the ability to receive metrics on an interval.

func New

func New(log *log.Logger, collector Collector, interval time.Duration, publisher ...Publisher) (*Publish, error)

New creates a Publish for consuming and publishing metrics.

func (*Publish) Stop

func (p *Publish) Stop()

Stop is used to shutdown the goroutine collecting metrics.

type Publisher

type Publisher func(map[string]interface{})

Publisher defines a handler function that will be called on each interval.

type Stdout

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

Stdout provide our basic publishing.

func NewStdout

func NewStdout(log *log.Logger) *Stdout

NewStdout initializes stdout for publishing metrics.

func (*Stdout) Publish

func (s *Stdout) Publish(data map[string]interface{})

Publish publishers for writing to stdout.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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