Documentation
¶
Overview ¶
Package labels provides utilities for managing container labels used by the toolhive application.
Index ¶
- Constants
- func AddNetworkIsolationLabel(labels map[string]string, networkIsolation bool)
- func AddNetworkLabels(labels map[string]string, networkName string)
- func AddStandardLabels(labels map[string]string, ...)
- func FormatToolHiveFilter() string
- func GetContainerBaseName(labels map[string]string) string
- func GetContainerName(labels map[string]string) string
- func GetPort(labels map[string]string) (int, error)
- func GetToolType(labels map[string]string) string
- func GetTransportType(labels map[string]string) string
- func HasNetworkIsolation(labels map[string]string) bool
- func IsStandardToolHiveLabel(key string) bool
- func IsToolHiveContainer(labels map[string]string) bool
- func ParseLabel(label string) (string, string, error)
- func ParseLabelWithValidation(label string) (string, string, error)
Constants ¶
const ( // LabelPrefix is the prefix for all ToolHive labels LabelPrefix = "toolhive" // LabelToolHive is the label that indicates a container is managed by ToolHive LabelToolHive = "toolhive" // LabelName is the label that contains the container name LabelName = "toolhive-name" // LabelBaseName is the label that contains the base container name (without timestamp) LabelBaseName = "toolhive-basename" // LabelTransport is the label that contains the transport mode LabelTransport = "toolhive-transport" // LabelPort is the label that contains the port LabelPort = "toolhive-port" // LabelToolType is the label that indicates the type of tool LabelToolType = "toolhive-tool-type" // LabelNetworkIsolation indicates that the network isolation functionality is enabled. LabelNetworkIsolation = "toolhive-network-isolation" // LabelToolHiveValue is the value for the LabelToolHive label LabelToolHiveValue = "true" )
Variables ¶
This section is empty.
Functions ¶
func AddNetworkIsolationLabel ¶ added in v0.1.4
AddNetworkIsolationLabel adds the network isolation label to a container
func AddNetworkLabels ¶ added in v0.0.48
AddNetworkLabels adds network-related labels to a network
func AddStandardLabels ¶
func AddStandardLabels(labels map[string]string, containerName, containerBaseName, transportType string, port int)
AddStandardLabels adds standard labels to a container
func FormatToolHiveFilter ¶
func FormatToolHiveFilter() string
FormatToolHiveFilter formats a filter for ToolHive containers
func GetContainerBaseName ¶
GetContainerBaseName gets the base container name from labels
func GetContainerName ¶
GetContainerName gets the container name from labels
func GetToolType ¶
GetToolType gets the tool type from labels
func GetTransportType ¶
GetTransportType gets the transport type from labels
func HasNetworkIsolation ¶ added in v0.1.4
HasNetworkIsolation checks if a container has network isolation enabled.
func IsStandardToolHiveLabel ¶ added in v0.1.9
IsStandardToolHiveLabel checks if a label key is a standard ToolHive label that should not be passed through from user input or displayed to users
func IsToolHiveContainer ¶
IsToolHiveContainer checks if a container is managed by ToolHive
func ParseLabel ¶ added in v0.1.9
ParseLabel parses a label string in the format "key=value" and validates it according to Kubernetes label naming conventions
Types ¶
This section is empty.