Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultSecretNamespace = "kollect-system" //nolint:gosec // namespace name, not a credential
Variables ¶
This section is empty.
Functions ¶
func RunConnectionTest ¶ added in v0.0.4
func RunConnectionTest( ctx context.Context, spec kollectdevv1alpha1.KollectSinkSpec, buildCtx BuildContext, ) (string, error)
RunConnectionTest probes sink connectivity using the same backends as export.
Types ¶
type Backend ¶
type Backend interface {
Type() string
Export(ctx context.Context, payload []byte, path string) error
}
Backend exports inventory payloads to an external destination.
type BuildContext ¶ added in v0.0.4
type BuildContext struct {
CAPEM []byte
SecretData map[string][]byte
DatabaseSecretData map[string][]byte
}
BuildContext carries resolved material for backend construction.
func BuildContextFromSpec ¶ added in v0.0.4
func BuildContextFromSpec( ctx context.Context, c client.Reader, spec kollectdevv1alpha1.KollectSinkSpec, defaultNamespace string, ) (BuildContext, error)
BuildContextFromSpec resolves secrets and TLS material for a KollectSink spec.
type Credentials ¶ added in v0.0.4
Credentials holds key material resolved from a Kubernetes Secret.
func ResolveSecret ¶ added in v0.0.4
func ResolveSecret( ctx context.Context, c client.Reader, ref *kollectdevv1alpha1.SecretReference, defaultNamespace string, ) (Credentials, error)
ResolveSecret loads secretRef from the API server.
type Factory ¶
type Factory func(spec kollectdevv1alpha1.KollectSinkSpec, ctx BuildContext) (Backend, error)
Factory constructs a Backend from a KollectSink spec.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maps sink type strings to backend factories.
func NewRegistry ¶
func NewRegistry() *Registry
NewRegistry returns a registry with built-in backends registered.
func (*Registry) NewBackend ¶
func (r *Registry) NewBackend( spec kollectdevv1alpha1.KollectSinkSpec, ctx BuildContext, ) (Backend, error)
NewBackend resolves spec.Type via the registry and constructs a backend instance.
Click to show internal directories.
Click to hide internal directories.