Documentation
¶
Overview ¶
Package types contains types and validation functions for workloads in ToolHive. This is separated to avoid circular dependencies with the core package.
Index ¶
- Variables
- func GetEffectiveProxyMode(transportType types.TransportType, proxyMode string) string
- func MatchesLabelFilters(workloadLabels, filters map[string]string) bool
- func ParseLabelFilters(labelFilters []string) (map[string]string, error)
- func SanitizeWorkloadName(name string) (string, bool)
- func ValidateWorkloadName(name string) error
- func WorkloadFromContainerInfo(container *runtime.ContainerInfo, runConfigStore state.Store) (core.Workload, error)
- type WorkloadNameIssue
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidWorkloadName = naming.ErrInvalidWorkloadName
ErrInvalidWorkloadName is naming.ErrInvalidWorkloadName.
Functions ¶
func GetEffectiveProxyMode ¶ added in v0.3.7
func GetEffectiveProxyMode(transportType types.TransportType, proxyMode string) string
GetEffectiveProxyMode determines the effective proxy mode that clients should use. For stdio transports, this returns the proxy mode (sse or streamable-http). For direct transports (sse/streamable-http), this returns the transport type as the proxy mode.
Prefer types.EffectiveProxyMode for new code operating on typed values.
func MatchesLabelFilters ¶
MatchesLabelFilters checks if workload labels match all the specified filters
func ParseLabelFilters ¶
ParseLabelFilters parses label filters from a slice of strings and validates them.
func SanitizeWorkloadName ¶ added in v0.2.14
SanitizeWorkloadName calls naming.SanitizeWorkloadName.
func ValidateWorkloadName ¶
ValidateWorkloadName calls naming.ValidateWorkloadName.
func WorkloadFromContainerInfo ¶
func WorkloadFromContainerInfo(container *runtime.ContainerInfo, runConfigStore state.Store) (core.Workload, error)
WorkloadFromContainerInfo creates a Workload struct from the runtime container info. The runConfigStore is used to load run configuration fields (proxy mode, group) without hitting the real filesystem, enabling proper dependency injection for tests.
Types ¶
type WorkloadNameIssue ¶ added in v0.2.14
type WorkloadNameIssue = naming.WorkloadNameIssue
WorkloadNameIssue is naming.WorkloadNameIssue.