labels

package
v0.0.0-...-dc2a067 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b Labels) int

Compare compares the two label sets. The result will be 0 if a==b, <0 if a < b, and >0 if a > b.

Types

type Label

type Label struct {
	Name, Value string
}

Label is a key/value pair of strings.

func (*Label) Tag

func (l *Label) Tag() string

func (*Label) ToByte

func (l *Label) ToByte() []byte

type Labels

type Labels []Label

func FromMap

func FromMap(m map[string]string) Labels

func New

func New(ls ...Label) Labels

New returns a sorted Labels from the given labels. The caller has to guarantee that all label names are unique.

func (Labels) Equals

func (ls Labels) Equals(o Labels) bool

func (Labels) Hash

func (ls Labels) Hash() uint64

Hash returns a hash value for the label set.

func (Labels) Len

func (ls Labels) Len() int

func (Labels) Less

func (ls Labels) Less(i, j int) bool

func (Labels) Serialize

func (ls Labels) Serialize() string

func (Labels) String

func (ls Labels) String() string

func (Labels) Swap

func (ls Labels) Swap(i, j int)

Jump to

Keyboard shortcuts

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