variable

package
v0.0.0-...-f53b987 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProtoToString

func ProtoToString(p *oproto.StreamVariable) string

Types

type Variable

type Variable struct {
	Variable     string
	Labels       map[string]string
	MinTimestamp int64
	MaxTimestamp int64
}

Variable represents a variable name with all labels.

func NewFromProto

func NewFromProto(p *oproto.StreamVariable) *Variable

NewFromProto creates a new Variable from the supplied protobuf.

func NewFromString

func NewFromString(textvar string) *Variable

NewFromString creates a new Variable from the supplied string.

func (*Variable) AsProto

func (v *Variable) AsProto() (p *oproto.StreamVariable)

AsProto returns the Variable encoded as a new StreamVariable protobuf.

func (*Variable) Match

func (v *Variable) Match(match *Variable) bool

Match checks that the supplied variable matches this one, using the matching rules defined above.

func (*Variable) ParseFromProto

func (v *Variable) ParseFromProto(p *oproto.StreamVariable) error

ParseFromProto extracts the details from a protobuf.

func (*Variable) ParseFromString

func (v *Variable) ParseFromString(textvar string) error

ParseFromString extracts the variable name and all labels from a string.

func (*Variable) String

func (v *Variable) String() string

String returns the complete variable as a string, including all labels correctly quoted.

func (*Variable) TimestampInsideRange

func (v *Variable) TimestampInsideRange(timestamp uint64) bool

func (*Variable) ToProto

func (v *Variable) ToProto(p *oproto.StreamVariable)

AsProto encodes the Variable into an existing protobuf.

Jump to

Keyboard shortcuts

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