filelog

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFile

func ParseFile(filePath, agentID string) ([]domain.Entry, error)

ParseFile reads a .md or .md.gz file and returns all entries found within.

func ParseFileBytes

func ParseFileBytes(data []byte, agentID, sourceFile string) []domain.Entry

ParseFileBytes parses raw file bytes and returns all entries found within. agentID is taken from the caller (typically the directory name); sourceFile is the path used for the SourceFile field on each entry.

Types

type FileStore

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

FileStore manages per-agent flat-file memory logs.

func NewFileStore

func NewFileStore(notesDir string, maxFileSize int64, clock domain.Clock) *FileStore

NewFileStore creates a FileStore rooted at notesDir with per-file size limit. Pass nil for clock to use time.Now.

func (*FileStore) Write

func (fs *FileStore) Write(e domain.Entry) (path string, err error)

Write appends a formatted entry to the agent's current daily file, rolling to a new file if the size limit would be exceeded.

Jump to

Keyboard shortcuts

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