memory

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package memory stores turns for one run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID      string   `json:"ID"`
	Content string   `json:"Content"`
	Tags    []string `json:"Tags"`
}

type Log

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

Log is an off-by-default file of turns. The process still answers from memory after load.

func NewLog

func NewLog(path string) (*Log, error)

func (*Log) Delete

func (l *Log) Delete(ctx context.Context, id string) error

func (*Log) Recent

func (l *Log) Recent(ctx context.Context, n int) ([]Item, error)

func (*Log) Search

func (l *Log) Search(ctx context.Context, query string) ([]Item, error)

func (*Log) Store

func (l *Log) Store(ctx context.Context, item Item) error

type Map added in v0.1.2

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

func New added in v0.1.2

func New() *Map

func (*Map) Delete added in v0.1.2

func (m *Map) Delete(ctx context.Context, id string) error

func (*Map) Recent added in v0.1.2

func (m *Map) Recent(ctx context.Context, n int) ([]Item, error)

func (*Map) Search added in v0.1.2

func (m *Map) Search(ctx context.Context, query string) ([]Item, error)

func (*Map) Store added in v0.1.2

func (m *Map) Store(ctx context.Context, item Item) error

Jump to

Keyboard shortcuts

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