Documentation
¶
Overview ¶
Package memory defines orb's root-level durable memory SDK seam. It is a orb-original addition with no upstream mirror and is importable standalone.
Index ¶
- type FileStore
- func (store *FileStore) Append(ctx context.Context, item Item) (string, error)
- func (store *FileStore) Delete(ctx context.Context, id string) error
- func (store *FileStore) Get(ctx context.Context, id string) (Item, error)
- func (store *FileStore) Query(ctx context.Context, filter Filter) ([]Item, error)
- func (store *FileStore) Transact(ctx context.Context, fn func(Store) error) error
- type Filter
- type Item
- type Scored
- type SemanticSearcher
- type Store
- type TransactionalStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
func NewFileStore ¶
type Item ¶
type Item struct {
ID string `json:"id"`
Time time.Time `json:"time"`
Content string `json:"content"`
Tags []string `json:"tags,omitempty"`
Meta map[string]string `json:"meta,omitempty"`
}
func ParseJournal ¶ added in v0.8.0
ParseJournal validates an offline migration source without skipping damaged records.
type SemanticSearcher ¶
SemanticSearcher returns highest-scoring items first and honors positive limit values.
type Store ¶
type Store interface {
Append(context.Context, Item) (string, error)
Get(context.Context, string) (Item, error)
Query(context.Context, Filter) ([]Item, error)
Delete(context.Context, string) error
}
Store is a tenant-scoped durable memory backend. Implementations must accept concurrent calls. Query returns newest items first, treats Tags as an AND filter, matches Contains case-insensitively, and honors positive Limit values.
Click to show internal directories.
Click to hide internal directories.