watcher

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Debouncer

type Debouncer struct {
	// contains filtered or unexported fields
}

func NewDebouncer

func NewDebouncer(interval time.Duration) *Debouncer

func (*Debouncer) Stop

func (d *Debouncer) Stop()

func (*Debouncer) Trigger

func (d *Debouncer) Trigger(key string, fn func())

type Event

type Event struct {
	SessionID string
	Path      string
	Lines     [][]byte
}

type Tailer

type Tailer struct {
	// contains filtered or unexported fields
}

func NewTailer

func NewTailer(path string) *Tailer

NewTailer creates a tailer for path. Files ending in ".json" (but not ".jsonl") are treated as whole-file-rewrite sources; everything else is tailed by byte offset as an append-only line stream.

func (*Tailer) Offset

func (t *Tailer) Offset() int64

func (*Tailer) ReadNewLines

func (t *Tailer) ReadNewLines() ([][]byte, error)

func (*Tailer) SeekEnd

func (t *Tailer) SeekEnd() error

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

func New

func New(logger *slog.Logger) *Watcher

func (*Watcher) AddFile

func (w *Watcher) AddFile(path, sessionID string, seekEnd bool)

func (*Watcher) Close

func (w *Watcher) Close() error

func (*Watcher) Events

func (w *Watcher) Events() <-chan Event

func (*Watcher) RemoveFile

func (w *Watcher) RemoveFile(path string)

func (*Watcher) Watch

func (w *Watcher) Watch(ctx context.Context, basePath string) error

Jump to

Keyboard shortcuts

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