filesource

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

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 NewSink

func NewSink(dir string) (*FileSink, error)

NewSink returns a FileSink rooted at dir, creating dir if absent.

func (*FileSink) Append

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.

func (*FileSink) Name

func (*FileSink) Name() string

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)

Jump to

Keyboard shortcuts

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