labels

package
v0.0.0-...-e7c9706 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

View Source
const (
	DNS1123LabelMaxLength = 63 // Public for testing only.

)

Variables

This section is empty.

Functions

func IsDNS1123Label

func IsDNS1123Label(value string) bool

IsDNS1123Label tests for a string that conforms to the definition of a label in DNS (RFC 1123).

func IsWildcardDNS1123Label

func IsWildcardDNS1123Label(value string) bool

IsWildcardDNS1123Label tests for a string that conforms to the definition of a label in DNS (RFC 1123), but allows the wildcard label (`*`), and typical labels with a leading astrisk instead of alphabetic character (e.g. "*-foo")

Types

type Instance

type Instance map[string]string

Instance is a non empty map of arbitrary strings. Each version of a service can be differentiated by a unique set of labels associated with the version. These labels are assigned to all instances of a particular service version. For example, lets say catalog.mystore.com has 2 versions v1 and v2. v1 instances could have labels gitCommit=aeiou234, region=us-east, while v2 instances could have labels name=kittyCat,region=us-east.

func (Instance) Equals

func (i Instance) Equals(that Instance) bool

Equals returns true if the labels are equal.

func (Instance) Match

func (i Instance) Match(that Instance) bool

Match is true if the label has same values for the keys. if len(i) == 0, will return false. It is mainly used for service -> workload

func (Instance) String

func (i Instance) String() string

func (Instance) SubsetOf

func (i Instance) SubsetOf(that Instance) bool

SubsetOf is true if the label has same values for the keys

func (Instance) Validate

func (i Instance) Validate() error

Validate ensures tag is well-formed

Jump to

Keyboard shortcuts

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