Publish ITWorx Pulse source
Public source validation / validate (push) Failing after 3m8s

This commit is contained in:
ITWorx Pulse release export
2026-09-03 02:09:19 +02:00
commit bd774932d5
614 changed files with 77116 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
package host
import (
"context"
"time"
)
// RawSource is the narrow read-only boundary implemented by an authenticated
// agent or another approved host telemetry source. It returns one bounded
// source snapshot; it cannot execute arbitrary host commands.
type RawSource interface {
Snapshot(context.Context) (RawSnapshot, error)
}
type Adapter struct {
Source RawSource
Limits Limits
Policy Policy
Now func() time.Time
}
func (a Adapter) Snapshot(ctx context.Context) (Snapshot, error) {
if err := ctx.Err(); err != nil {
return Snapshot{}, err
}
if a.Source == nil {
return UnknownSnapshot(time.Now().UTC(), "host", "agent", "source_unavailable"), nil
}
raw, err := a.Source.Snapshot(ctx)
if err != nil {
return Snapshot{}, err
}
now := time.Now().UTC()
if a.Now != nil {
now = a.Now()
}
return Normalize(raw, now, a.Limits, a.Policy)
}