watch

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2018 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = 10 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func(uint64, interface{})

HandlerFunc is used to handle new data

type HttpHandlerConfig added in v1.0.1

type HttpHandlerConfig struct {
	Path          string              `mapstructure:"path"`
	Method        string              `mapstructure:"method"`
	Timeout       time.Duration       `mapstructure:"-"`
	TimeoutRaw    string              `mapstructure:"timeout"`
	Header        map[string][]string `mapstructure:"header"`
	TLSSkipVerify bool                `mapstructure:"tls_skip_verify"`
}

type Plan added in v0.8.2

type Plan struct {
	Datacenter  string
	Token       string
	Type        string
	HandlerType string
	Exempt      map[string]interface{}

	Watcher   WatcherFunc
	Handler   HandlerFunc
	LogOutput io.Writer
	// contains filtered or unexported fields
}

Plan is the parsed version of a watch specification. A watch provides the details of a query, which generates a view into the Consul data store. This view is watched for changes and a handler is invoked to take any appropriate actions.

func Parse

func Parse(params map[string]interface{}) (*Plan, error)

Parse takes a watch query and compiles it into a WatchPlan or an error

func ParseExempt

func ParseExempt(params map[string]interface{}, exempt []string) (*Plan, error)

ParseExempt takes a watch query and compiles it into a WatchPlan or an error Any exempt parameters are stored in the Exempt map

func (*Plan) IsStopped added in v0.8.5

func (p *Plan) IsStopped() bool

func (*Plan) Run added in v0.8.2

func (p *Plan) Run(address string) error

Run is used to run a watch plan

func (*Plan) Stop added in v0.8.2

func (p *Plan) Stop()

Stop is used to stop running the watch plan

type WatcherFunc added in v0.8.2

type WatcherFunc func(*Plan) (uint64, interface{}, error)

WatcherFunc is used to watch for a diff

Jump to

Keyboard shortcuts

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