watcher

package
v0.0.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointType

type EndpointType string

EndpointType is the Nomad API endpoint type support for watching.

const (
	// Allocations represents the Nomad Allocations API endpoint.
	Allocations EndpointType = "allocations"

	// Deployments represents the Nomad Deployments API endpoint.
	Deployments EndpointType = "deployments"
)

type Watcher

type Watcher struct {
	EndpointType
	// contains filtered or unexported fields
}

Watcher is the main watcher struct which holds all config items for running a watcher.

func NewWatcher

func NewWatcher(cfg *config.NomadConfig, et EndpointType, mChan chan interface{}) (*Watcher, error)

NewWatcher builds a new watcher struct in order to run the nomad-toast watcher task. The message channel is importantly where events are sent for notification.

func (*Watcher) Run

func (w *Watcher) Run()

Run triggers the watcher of configured type to be run. This will monitor the endpoint for changes and pass them to the notifier for notifications.

Jump to

Keyboard shortcuts

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