Documentation
¶
Index ¶
- type Object
- type Store
- func (s *Store) Create(typeName string, fields map[string]any) (*Object, error)
- func (s *Store) Delete(typeName, id string) error
- func (s *Store) Get(typeName, id string) (*Object, error)
- func (s *Store) GetExact(typeName, id string) (*Object, error)
- func (s *Store) List(typeName string) ([]string, error)
- func (s *Store) ListExact(typeName string) ([]string, error)
- func (s *Store) LoadAll(typeName string) ([]*Object, error)
- func (s *Store) LoadExactAll(typeName string) ([]*Object, error)
- func (s *Store) Update(typeName, id string, fields map[string]any, merge bool) (*Object, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Object ¶
type Object struct {
Type string
ID string
Fields map[string]any
File string
Inline bool
ReadOnly bool
}
Object represents a single database object loaded from disk.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store coordinates reading and writing objects on disk.
func NewStoreWithOps ¶ added in v0.7.0
NewStoreWithOps constructs a data store rooted at the given directory using the provided file operations.
func (*Store) GetExact ¶ added in v0.9.0
GetExact returns the object by identifier, restricting the lookup to objects declared exactly as typeName.
func (*Store) ListExact ¶ added in v0.9.0
ListExact returns sorted identifiers for objects declared exactly as the specified type.
func (*Store) LoadExactAll ¶ added in v0.9.0
LoadExactAll retrieves all objects declared exactly as typeName.
Click to show internal directories.
Click to hide internal directories.