utils

package
v1.8.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLabelDup  = errors.New("duplicate label")
	ErrLabelName = errors.New("bad label name")
)

Functions

This section is empty.

Types

type LabelMappingFlag

type LabelMappingFlag struct {
	Labels []string
	Keys   []string
}

LabelMappingFlag parse server metadata to label kingpin option

Supported formats: - `label=key` - map metadata *key* value to *label*; - `key` - same as above if *label* equal to *key*.

Accept multiple mappings separated by comma (','). One metadata key may be mapped into multiple labels, but not vice versa.

func LabelMapping

func LabelMapping(s kingpin.Settings) *LabelMappingFlag

func (*LabelMappingFlag) Extract

func (s *LabelMappingFlag) Extract(m map[string]string) []string

func (*LabelMappingFlag) IsCumulative

func (s *LabelMappingFlag) IsCumulative() bool

func (*LabelMappingFlag) Set

func (s *LabelMappingFlag) Set(value string) error

func (*LabelMappingFlag) String

func (s *LabelMappingFlag) String() string

Jump to

Keyboard shortcuts

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