models

package
v0.0.0-...-9741fed Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchType

type MatchType int

MatchType is an enum for label matching types.

const (
	MatchEqual MatchType = iota
	MatchNotEqual
	MatchRegexp
	MatchNotRegexp
)

Possible MatchTypes.

func (MatchType) String

func (m MatchType) String() string

type Matcher

type Matcher struct {
	Type  MatchType `json:"type"`
	Name  string    `json:"name"`
	Value string    `json:"value"`
	// contains filtered or unexported fields
}

Matcher models the matching of a label.

func NewMatcher

func NewMatcher(t MatchType, n, v string) (*Matcher, error)

NewMatcher returns a matcher object.

func (*Matcher) Matches

func (m *Matcher) Matches(s string) bool

Matches returns whether the matcher matches the given string value.

func (*Matcher) String

func (m *Matcher) String() string

type Matchers

type Matchers []*Matcher

Matchers is of matchers

func (Matchers) ToTags

func (m Matchers) ToTags() (Tags, error)

ToTags converts Matchers to Tags NB (braskin): this only works for exact matches

type Metric

type Metric struct {
	Namespace string
	ID        string
	Tags      Tags
}

Metric is the individual metric that gets returned from the search endpoint

type Metrics

type Metrics []*Metric

Metrics is a list of individual metrics

type Tags

type Tags map[string]string

Tags is a key/value map of metric tags.

func (Tags) ID

func (t Tags) ID() string

ID returns a string representation of the tags

Jump to

Keyboard shortcuts

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