output

package
v0.0.10-travis Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console interface {
	GetError() error
	GetStdOut() []string
	GetStdErrOut() []string
}

type JsonMarshaller

type JsonMarshaller interface {
	ToJson() []byte
}

JsonMarshaller defines objects that can be marshalled to json.

type Output

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

Output handles all output during an operation

func New

func New(webhookURL, promURL, hostname string) *Output

New returns a new output object. It handles all the different outputs that should happen during a wrestic operation.

func (*Output) Register

func (o *Output) Register(out Outputter)

Register adds an object to the slice of outputs to handle

func (*Output) TriggerAll

func (o *Output) TriggerAll()

TriggerAll handles all the registered outputs and pushes the output to the webhook/prometheus endpoint.

func (*Output) TriggerHook

func (o *Output) TriggerHook(data JsonMarshaller)

TriggerHook pushes a single json

func (*Output) TriggerProm

func (o *Output) TriggerProm(prom prometheus.Collector)

TriggerProm pushes a prometheus collector

type Outputter

type Outputter interface {
	Webhook
	Prometheus
	Console
}

Outputter bundles Webhook and Prometheus into one interface

type Prometheus

type Prometheus interface {
	// ToProm should return a slice of prometheus collectors that are ready to
	// be sent to the push gateway.
	ToProm() []prometheus.Collector
}

Prometheus defines an interface to send stats to a prometheus push gateway

type Trigger

type Trigger interface {
	TriggerHook(data JsonMarshaller)
	TriggerProm(prom prometheus.Collector)
}

Trigger is the interface used for a single. Also intended for the use outside of the output module.

type Webhook

type Webhook interface {
	// GetWebhookData should return a slice with all the objects that should be
	// sent to the webhook endpoint.
	GetWebhookData() []JsonMarshaller
}

Webhook defines an interface to send stats to a webhook url

Jump to

Keyboard shortcuts

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