watch

package
v0.0.0-test Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 5 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

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 WatchFunc

type WatchFunc func(*WatchPlan) (uint64, interface{}, error)

WatchFunc is used to watch for a diff

type WatchPlan

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

	Func      WatchFunc
	Handler   HandlerFunc
	Fail      func() bool
	Recover   func()
	LogOutput io.Writer

	Key        string
	CongestCtl bool
	// contains filtered or unexported fields
}

WatchPlan 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{}) (*WatchPlan, 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) (*WatchPlan, 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 (*WatchPlan) Pause

func (p *WatchPlan) Pause()

func (*WatchPlan) Resume

func (p *WatchPlan) Resume()

func (*WatchPlan) Run

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

Run is used to run a watch plan

func (*WatchPlan) Stop

func (p *WatchPlan) Stop()

Stop is used to stop running the watch plan

Jump to

Keyboard shortcuts

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