Documentation
¶
Index ¶
- type JSONLRepository
- func (r *JSONLRepository) CleanupOlderThan(ctx context.Context, maxAge time.Duration) (int, error)
- func (r *JSONLRepository) Close()
- func (r *JSONLRepository) Create(ctx context.Context, l *tasklog.TaskLog) error
- func (r *JSONLRepository) DeleteByTaskID(ctx context.Context, taskID string) (int, error)
- func (r *JSONLRepository) List(ctx context.Context, taskID string, taskIDs []string, limit, offset int) ([]*tasklog.TaskLog, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONLRepository ¶ added in v0.0.41
type JSONLRepository struct {
// contains filtered or unexported fields
}
JSONLRepository implements tasklog.Repository using JSONL files on the local filesystem.
The in-memory index is built lazily on a per-task basis: the first time a task's logs are requested, its directory is scanned and the IDs are cached. Subsequent reads serve from the index without another directory walk. A task.Repository is used to enumerate active tasks when a global List is issued; archived tasks are not scanned by default. The task.Repository is optional — tests and edge cases (orphaned log directories) fall back to a filesystem search.
func NewJSONLRepository ¶ added in v0.0.41
func NewJSONLRepository(baseDir string, taskRepo task.Repository) *JSONLRepository
NewJSONLRepository constructs a JSONLRepository rooted at baseDir. The taskRepo is used to enumerate active tasks and resolve taskID → projectID; nil is accepted for tests and orphan-log scenarios (in which case the repo falls back to directory scanning).
func (*JSONLRepository) CleanupOlderThan ¶ added in v0.0.41
func (*JSONLRepository) Close ¶ added in v0.0.41
func (r *JSONLRepository) Close()
Close closes all open turn file handles.