label

package
v2.3.3-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: Apache-2.0 Imports: 2 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.

func NewFromPlainMap

func NewFromPlainMap(input map[string]string) FlowLabels

NewFromPlainMap returns flow labels from normal map[string]string. Telemetry flag is set to true for all flow 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) ToPlainMap

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

ToPlainMap returns flow labels as normal map[string]string.

Jump to

Keyboard shortcuts

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