Documentation
¶
Overview ¶
Package memory persists immutable Markdown nodes in a project-local graph.
Memory storage supports Windows, Linux and macOS, excluding Android. NewStore fails with ErrInvalidInput on other platforms rather than using mutable pathnames. Supported stores require hard-link support because completed nodes are published with an atomic no-replace link operation. Linux also requires procfs access through /proc/self/fd. NewStore fails safely if that pinned-directory path is unavailable. macOS uses descriptor-relative operations instead of procfs. Stores retain the pinned nodes directory for their lifetime so concurrent path replacement cannot redirect reads or writes. Call Store.Close to release that platform resource.
Index ¶
Constants ¶
const ( MaxTitleRunes = 200 MaxBodyBytes = 64 * 1024 MaxTags = 32 MaxLinks = 64 DefaultLimit = 20 MaxLimit = 100 )
Variables ¶
var ( ErrNotFound = errors.New("memory node not found") ErrInvalidInput = errors.New("invalid memory input") )
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
ID string `json:"id"`
Title string `json:"title"`
Body string `json:"body"`
CreatedBy string `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
Tags []string `json:"tags,omitempty"`
Links []string `json:"links,omitempty"`
Supersedes string `json:"supersedes,omitempty"`
Archived bool `json:"archived"`
}
type ProjectDirectory ¶
ProjectDirectory is a pinned project-root capability. Implementations must expose a canonical path for identity checks and a handle-anchored operation path for child creation.
type SearchInput ¶
type SearchResult ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStoreInProject ¶
func NewStoreInProject(project ProjectDirectory) (*Store, error)
NewStoreInProject creates the fixed "memory" child only through a pinned Registry project capability, then proves that the pinned memory root and nodes directory still match their canonical identities inside that project.
func (*Store) Search ¶
func (s *Store) Search(ctx context.Context, input SearchInput) (SearchResult, error)
type Summary ¶
type Summary struct {
ID string `json:"id"`
Title string `json:"title"`
CreatedBy string `json:"created_by"`
Snippet string `json:"snippet"`
CreatedAt time.Time `json:"created_at"`
Tags []string `json:"tags,omitempty"`
Links []string `json:"links,omitempty"`
Supersedes string `json:"supersedes,omitempty"`
Archived bool `json:"archived"`
}