model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2018 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 Cluster

type Cluster struct {
	Name  string `yaml:"name"`
	Nodes []Node `yaml:"nodes"`
	Rules []Rule `yaml:"rules"`
}

type DurationCriteria

type DurationCriteria struct {
	Op       string
	Duration time.Duration
}

func NewDurationCriteria

func NewDurationCriteria(s string) (DurationCriteria, error)

func (*DurationCriteria) IsZero

func (d *DurationCriteria) IsZero() bool

func (*DurationCriteria) Satisfy

func (d *DurationCriteria) Satisfy(start, end time.Time) bool

func (*DurationCriteria) UnmarshalYAML

func (d *DurationCriteria) UnmarshalYAML(unmarshal func(interface{}) error) error

type Node

type Node struct {
	Name     string              `yaml:"name"`
	Url      string              `yaml:"url"`
	Relabels []*pc.RelabelConfig `yaml:"relabels"`
}

type Rule

type Rule struct {
	Target  string           `yaml:"target"`
	Default bool             `yaml:"default"`
	Range   DurationCriteria `yaml:"range"`
	Time    TimeCriteria     `yaml:"time"`
	Start   TimeCriteria     `yaml:"start"`
	End     TimeCriteria     `yaml:"end"`
}

type TimeCriteria

type TimeCriteria struct {
	Op   string
	Time time.Time
}

func NewTimeCriteria

func NewTimeCriteria(s string) (TimeCriteria, error)

func (*TimeCriteria) IsZero

func (t *TimeCriteria) IsZero() bool

func (*TimeCriteria) Satisfy

func (t *TimeCriteria) Satisfy(ts time.Time) bool

func (*TimeCriteria) UnmarshalYAML

func (t *TimeCriteria) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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