Documentation
¶
Overview ¶
Package filesource is the local-directory feed source: zero infrastructure, directly inspectable, useful for development and as a drop point a sidecar can write into.
Each event is one JSON file in the directory (any name ending .json), holding a single controlevent.Event. Poll returns the events with ControlVersion > since, sorted ascending. A malformed file fails the poll loudly (the applier logs and retries next tick) rather than silently dropping an event and letting the fleet diverge.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSink ¶
type FileSink struct {
// contains filtered or unexported fields
}
FileSink writes events to a directory.
func (*FileSink) Append ¶
func (s *FileSink) Append(_ context.Context, e controlevent.Event) (controlevent.Event, error)
Append writes e to <dir>/<event_id>.json with a stamped ControlVersion. Idempotent on EventID: a retry returns the same ControlVersion the existing file records.
type FileSource ¶
type FileSource struct {
// contains filtered or unexported fields
}
FileSource reads events from a directory.
func New ¶
func New(dir string) (*FileSource, error)
New returns a FileSource rooted at dir, creating dir (with parents) if absent. A failure here is a startup error.
func (*FileSource) Name ¶
func (*FileSource) Name() string
func (*FileSource) Poll ¶
func (fs *FileSource) Poll(_ context.Context, since uint64) ([]controlevent.Event, error)