rule

package
v0.4.2-alpha.0...-9a8b422 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2016 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(order string) (func(float64) bool, error)

Decode a logical rule (ex. ">0.75")

func Watcher

func Watcher(c chan error, r types.Rule)

Watcher check periodically the rule and report back errors TODO channel back to kill if needed

Types

type FloatValue

type FloatValue struct {
	RuleName       string               `json:"rule"`
	ServiceName    string               `json:"service"`
	Scale          types.Scaler         `json:"-"`
	ScalerID       string               `json:"scaler"`
	Probe          types.Probe          `json:"-"`
	ProbeID        string               `json:"probe"`
	RefreshRate    time.Duration        `json:"resfreshRate"`
	UpDefinition   string               `json:"up"`
	Up             func(v float64) bool `json:"-"`
	DownDefinition string               `json:"down"`
	Down           func(v float64) bool `json:"-"`
}

FloatValue handler

func (*FloatValue) Check

func (r *FloatValue) Check() error

Check the probe, UP and DOWN

func (*FloatValue) CheckInterval

func (r *FloatValue) CheckInterval() time.Duration

CheckInterval return the time to wait between each check

func (*FloatValue) JSON

func (r *FloatValue) JSON() ([]byte, error)

JSON encode

func (*FloatValue) Parse

func (r *FloatValue) Parse() (err error)

Parse UpDefinition and DownDefinition directives to create matching functions

Jump to

Keyboard shortcuts

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