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 ¶
func (dm *DetectorManager) DetectContext(container *containercollection.Container) (contextdetection.ContextInfo, error)
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 (h *HostContextInfo) Context() contextdetection.EventSourceContext
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 (hd *HostDetector) Detect(container *containercollection.Container) (contextdetection.ContextInfo, bool)
func (*HostDetector) Priority ¶
func (hd *HostDetector) Priority() int
type K8sContextInfo ¶
func (*K8sContextInfo) Context ¶
func (k *K8sContextInfo) Context() contextdetection.EventSourceContext
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 (kd *K8sDetector) Detect(container *containercollection.Container) (contextdetection.ContextInfo, bool)
func (*K8sDetector) Priority ¶
func (kd *K8sDetector) Priority() int
type StandaloneContextInfo ¶
func (*StandaloneContextInfo) Context ¶
func (s *StandaloneContextInfo) Context() contextdetection.EventSourceContext
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 (sd *StandaloneDetector) Detect(container *containercollection.Container) (contextdetection.ContextInfo, bool)
func (*StandaloneDetector) Priority ¶
func (sd *StandaloneDetector) Priority() int
Click to show internal directories.
Click to hide internal directories.