detectors

package
v0.3.17 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidContainer = errors.New("invalid container: nil provided")
)

Functions

This section is empty.

Types

type DetectorManager

type DetectorManager struct {
	// contains filtered or unexported fields
}

func NewDetectorManager

func NewDetectorManager(registry contextdetection.Registry) *DetectorManager

NewDetectorManager creates a new DetectorManager with the given registry. Detectors are initialized in priority order: K8s (0), Host (1), Standalone (2).

func (*DetectorManager) DetectContext

DetectContext detects the context of a container by running detectors in priority order. Returns the ContextInfo from the first detector that matches, or a default Standalone context if no detector matches.

type HostContextInfo

type HostContextInfo struct {
	HostName string
}

func (*HostContextInfo) Context

func (*HostContextInfo) WorkloadID

func (h *HostContextInfo) WorkloadID() string

type HostDetector

type HostDetector struct {
	// contains filtered or unexported fields
}

func NewHostDetector

func NewHostDetector() *HostDetector

func (*HostDetector) Detect

func (*HostDetector) Priority

func (hd *HostDetector) Priority() int

type K8sContextInfo

type K8sContextInfo struct {
	Namespace   string
	PodName     string
	Workload    string
	WorkloadUID string
}

func (*K8sContextInfo) Context

func (*K8sContextInfo) WorkloadID

func (k *K8sContextInfo) WorkloadID() string

type K8sDetector

type K8sDetector struct {
	// contains filtered or unexported fields
}

func NewK8sDetector

func NewK8sDetector() *K8sDetector

func (*K8sDetector) Detect

func (*K8sDetector) Priority

func (kd *K8sDetector) Priority() int

type StandaloneContextInfo

type StandaloneContextInfo struct {
	ContainerID   string
	ContainerName string
}

func (*StandaloneContextInfo) Context

func (*StandaloneContextInfo) WorkloadID

func (s *StandaloneContextInfo) WorkloadID() string

type StandaloneDetector

type StandaloneDetector struct {
	// contains filtered or unexported fields
}

func NewStandaloneDetector

func NewStandaloneDetector() *StandaloneDetector

func (*StandaloneDetector) Detect

func (*StandaloneDetector) Priority

func (sd *StandaloneDetector) Priority() int

Jump to

Keyboard shortcuts

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