notifier

package
v0.0.0-...-0452748 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier interface {
	// Notify publishes changes detected by Sauron
	Notify(opts model.WatchOptions, lastUpdate, update model.Update) error
}

Notifier is the interface required by Sauron to publish changes

func New

func New(opts Options) Notifier

New returns a new concrete Notifier implementation depending on which options are set. If none, a basic notifier writing to stderr is returned

func NewFile

func NewFile(path string) Notifier

NewFile creates a basic Notifier that prints to the given file. If path is "", prints to stderr.

func NewSNS

func NewSNS(targetARN string) Notifier

NewSNS creates a Notifier that publishes events to an SNS topic

type Options

type Options struct {
	// SNS target options
	SNS struct {
		TopicARN string `long:"topic-arn" env:"SNS_TOPIC_ARN" description:"ARN of the SNS topic"`
	} `group:"notifier.sns" namespace:"sns"`

	// File target options. This is the default if nothing else is provided
	File struct {
		Path string `long:"path" default:"" env:"NOTIFY_FILE_PATH" description:"path of the state file"`
	} `group:"notifier.file" namespace:"file"`
}

Options contains the parameters necessary to configure a concrete Notifier implementation

Jump to

Keyboard shortcuts

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