memory

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(keyword, content string) error

Add appends a new memory entry. Returns an error if the keyword already exists.

func Remove

func Remove(keyword string) error

Remove deletes a memory entry by keyword (case-insensitive).

func Save

func Save(entries []Entry) error

Save writes memory entries to disk.

Types

type Entry

type Entry struct {
	Keyword string `json:"keyword"`
	Content string `json:"content"`
}

Entry represents a single memory key-value pair.

func FindMatching

func FindMatching(input string, entries []Entry) []Entry

FindMatching returns entries whose keywords appear in the input (case-insensitive).

func List

func List() ([]Entry, error)

List returns all memory entries.

func Load

func Load() ([]Entry, error)

Load reads all memory entries from disk. Returns empty slice if file not found.

Jump to

Keyboard shortcuts

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