label

package
v2.22.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLabelNotFound = errors.New("label not found")

ErrLabelNotFound is returned when a flow label is not found.

Functions

func Merge

func Merge(dst, src FlowLabels)

Merge combines two flow labels maps into one. Overwrites overlapping keys with values from src.

Types

type FlowLabelValue

type FlowLabelValue struct {
	Value     string
	Telemetry bool
}

FlowLabelValue is a value of a flow label with additional metadata.

type FlowLabels

type FlowLabels map[string]FlowLabelValue

FlowLabels is a map from flow labels to their values. Each value also stores some metadata.

FlowLabels implement labels.Labels to avoid conversion to plain map.

func (FlowLabels) Copy added in v2.7.0

func (fl FlowLabels) Copy() labels.PlainMap

Copy implements labels.Labels.

func (FlowLabels) Get added in v2.7.0

func (fl FlowLabels) Get(key string) (string, bool)

Get implements labels.Labels.

func (FlowLabels) GetBool

func (fl FlowLabels) GetBool(key string) (bool, error)

GetBool returns the bool value of a flow label with the given key. If the key is not found in the FlowLabels, it returns an error.

func (FlowLabels) GetFloat64

func (fl FlowLabels) GetFloat64(key string) (float64, error)

GetFloat64 returns the float64 value of a flow label with the given key. If the key is not found in the FlowLabels, it returns an error.

func (FlowLabels) GetInt64

func (fl FlowLabels) GetInt64(key string) (int64, error)

GetInt64 returns the int64 value of a flow label with the given key. If the key is not found in the FlowLabels, it returns an error.

func (FlowLabels) GetString

func (fl FlowLabels) GetString(key string) (string, error)

GetString returns the string value of a flow label with the given key. If the key is not found in the FlowLabels, it returns an error.

func (FlowLabels) GetUint64

func (fl FlowLabels) GetUint64(key string) (uint64, error)

GetUint64 returns uint64 value of a flow label.

func (FlowLabels) SortedKeys added in v2.7.0

func (fl FlowLabels) SortedKeys() []string

SortedKeys implements labels.Labels.

func (FlowLabels) TelemetryLabels added in v2.7.0

func (fl FlowLabels) TelemetryLabels() map[string]string

TelemetryLabels returns only labels that have Telemetry flag set.

Jump to

Keyboard shortcuts

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