repositoryimpl

package
v0.0.32 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type YAMLRepository

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

YAMLRepository implements tasklog.Repository using YAML files on Storage.

An in-memory index (taskID → sorted []logID) is built lazily on first access and maintained incrementally on Create/Delete. This avoids the need to read and YAML-parse every file on each List call.

func NewYAMLRepository

func NewYAMLRepository(s storage.Storage) *YAMLRepository

func (*YAMLRepository) CleanupOlderThan added in v0.0.28

func (r *YAMLRepository) CleanupOlderThan(ctx context.Context, maxAge time.Duration) (int, error)

CleanupOlderThan removes task log entries older than maxAge. It scans all log files, reads the created_at field using fast text extraction, and deletes entries that exceed the age threshold.

func (*YAMLRepository) Create

func (r *YAMLRepository) Create(ctx context.Context, l *tasklog.TaskLog) error

func (*YAMLRepository) DeleteByTaskID

func (r *YAMLRepository) DeleteByTaskID(ctx context.Context, taskID string) (int, error)

func (*YAMLRepository) List

func (r *YAMLRepository) List(ctx context.Context, taskID string, taskIDs []string, limit, offset int) ([]*tasklog.TaskLog, int, error)

Jump to

Keyboard shortcuts

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