types

package
v0.0.0-...-2b0a6a7 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// BackendName returns the name of the backend.
	BackendName() string
	// SampleConfig returns the sample config for the backend.
	SampleConfig() string
	// SendMetricsAsync flushes the metrics to the backend, preparing payload synchronously but doing the send asynchronously.
	// Must not read/write MetricMap asynchronously.
	SendMetricsAsync(context.Context, *types.MetricMap, SendCallback)
	// SendEvent sends event to the backend.
	SendEvent(context.Context, *types.Event) error
}

Backend represents a backend.

type Factory

type Factory func(*viper.Viper) (Backend, error)

Factory is a function that returns a Backend.

type RunnableBackend

type RunnableBackend interface {
	Backend
	// Run executes backend send operations. Should be started in a goroutine.
	Run(context.Context) error
}

RunnableBackend represents a backend that needs a Run method to be executed to work.

type SendCallback

type SendCallback func([]error)

SendCallback is called by Backend.SendMetricsAsync() to notify about the result of operation. A list of errors is passed to the callback. It may be empty or contain nil values. Every non-nil value is an error that happened while sending metrics.

Jump to

Keyboard shortcuts

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