types

package
v0.77.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

View Source
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

func MatchesLabelFilters(workloadLabels, filters map[string]string) bool

MatchesLabelFilters checks if workload labels match all the specified filters

func ParseLabelFilters

func ParseLabelFilters(labelFilters []string) (map[string]string, error)

ParseLabelFilters parses label filters from a slice of strings and validates them.

func SanitizeWorkloadName added in v0.2.14

func SanitizeWorkloadName(name string) (string, bool)

SanitizeWorkloadName calls naming.SanitizeWorkloadName.

func ValidateWorkloadName

func ValidateWorkloadName(name string) error

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.

Directories

Path Synopsis
Package errors contains error definitions for workloads It is located in a separate package to side-step an import cycle
Package errors contains error definitions for workloads It is located in a separate package to side-step an import cycle

Jump to

Keyboard shortcuts

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