watcher

package
v0.14.13 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler

type EventHandler func(RecordEvent)

EventHandler is called when a record changes.

type EventType

type EventType string

EventType describes what kind of change occurred to a record file.

const (
	EventTypeCreated  EventType = "created"
	EventTypeModified EventType = "modified"
	EventTypeDeleted  EventType = "deleted"
)

type FieldChange

type FieldChange struct {
	Field    string
	OldValue any
	NewValue any
}

FieldChange captures a single field-level change within a record.

type RecordEvent

type RecordEvent struct {
	Type    EventType
	Path    string
	Changes []FieldChange
}

RecordEvent represents a change to a single record file.

type Trigger

type Trigger interface {
	Name() string
	Fire(ctx context.Context, event RecordEvent) error
}

Trigger is a named handler that reacts to a RecordEvent. Built-in trigger types include webhook and shell exec. The watcher calls each registered Trigger.Fire() on change.

type Watcher

type Watcher interface {
	Watch(ctx context.Context, handler EventHandler) error
}

Watcher watches a database directory for record changes.

Jump to

Keyboard shortcuts

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