labels

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package labels provides parsing of labels into a key-value map.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Labels

type Labels map[string]string

Labels represents a set of labels (key-value pairs).

func MakeLabels

func MakeLabels(labels ...string) (Labels, error)

MakeLabels parses the passed labels arguments in either form of “foo=bar” or “foo=”, returning a Labels map for further use in the Docker API. In case of an invalid label (such as "", "=", or "=bar"), MakeLabels returns an error.

func (Labels) Add

func (l Labels) Add(label string) error

Add a single label to a Labels map, where the label must be either in “foo=bar” or “foo=” form. If the specified label isn't in either form, or empty, an error is returned instead.

Jump to

Keyboard shortcuts

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