Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface {
// GetObjectStore returns a store for a specific object type.
GetObjectStore(name string, sampleObject any) ObjectStore
}
Manager of multiple object stores that are persisted together.
type ObjectExistsError ¶
type ObjectExistsError struct{}
ObjectExistsError represents an error caused due to an object which exists.
func (*ObjectExistsError) Error ¶
func (e *ObjectExistsError) Error() string
type ObjectNotFoundError ¶
type ObjectNotFoundError struct{}
ObjectNotFoundError represents an error caused due to an object which does not exist.
func (*ObjectNotFoundError) Error ¶
func (e *ObjectNotFoundError) Error() string
type ObjectStore ¶
type ObjectStore interface {
// Create an object.
// Returns ObjectExistsError if object already exists.
Create(name string, object any) error
// Update an object.
// Returns ObjectNotFoundError if object does not exist.
Update(name string, mutator func(any) any) error
// Delete an object identified by the given name.
Delete(name string) error
// GetAll returns all of the objects in the store.
GetAll() ([]any, error)
}
ObjectStore represents a persistent store of objects.
Click to show internal directories.
Click to hide internal directories.