cmd

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHealthMetrics

func AddHealthMetrics(pulse Pulse, prometheusSubsystem string)

AddHealthMetrics adds a global health metric for the given pulse. This should only be called a single time per binary.

func AddHealthPort

func AddHealthPort(pulse Pulse, healthPort int)

AddHealthPort is used to expose the health over http.

func AddSignalHandler

func AddSignalHandler(pulse Pulse)

AddSignalHandler allows the controller to shutdown gracefully by respecting SIGTERM.

func ConfigureLogging

func ConfigureLogging(debug bool)

ConfigureLogging sets logging to Stdout and manages setting debug level

func ConfigureMetrics

func ConfigureMetrics(job string, prometheusLabels KeyValues, pushgatewayURL string, pushgatewayIntervalSeconds int)

ConfigureMetrics sets up metrics pushing and default labels. This must be called before any metrics are defined.

Types

type CommaSeparatedValues

type CommaSeparatedValues []string

CommaSeparatedValues represents a slice of strings that were originally separated by ','.

func (*CommaSeparatedValues) Set

func (c *CommaSeparatedValues) Set(value string) error

Set binds a comma separated command line flag value to a KeyValue.

func (*CommaSeparatedValues) String

func (c *CommaSeparatedValues) String() string

type KeyValue

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

KeyValue is a single 'key=value' pair

type KeyValues

type KeyValues []KeyValue

KeyValues for command line flag parsing of type 'key=value'

func (*KeyValues) Set

func (kv *KeyValues) Set(value string) error

Set binds a command line flag value to a KeyValue.

func (*KeyValues) String

func (kv *KeyValues) String() string

func (*KeyValues) Type

func (kv *KeyValues) Type() string

Type returns the identifier for this type

type Pulse

type Pulse interface {
	// Health returns the current health, nil if healthy.
	Health() error
	// Stop the thing that's alive.
	Stop() error
}

Pulse represents something alive whose health can be checked.

Jump to

Keyboard shortcuts

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