Documentation
¶
Index ¶
- Variables
- func New[E any](logger *logging.Logger, dao datastore.GenericDAO[E]) datastore.GenericDAO[E]
- func NewAferoDAO[E any](logger *logging.Logger, fs afero.Fs, rootDir string, partition string, ...) (datastore.GenericDAO[E], error)
- type AferoDAO
- func (aferoDAO *AferoDAO[E]) Count(CONSISTENCY_LEVEL int) (int, error)
- func (aferoDAO *AferoDAO[E]) Delete(entity E) error
- func (aferoDAO *AferoDAO[E]) ForEachPage(pageQuery datastore.PageQuery, pagerProcFunc datastore.PagerProcFunc[E], ...) error
- func (aferoDAO *AferoDAO[E]) Get(id uint64, CONSISTENCY_LEVEL int) (E, error)
- func (aferoDAO *AferoDAO[E]) Page(pageQuery datastore.PageQuery, CONSISTENCY_LEVEL int) (datastore.PageResult[E], error)
- func (aferoDAO *AferoDAO[E]) Save(entity E) error
- type KVStore
- func (kvstore *KVStore[E]) Count(CONSISTENCY_LEVEL int) (int, error)
- func (kvstore *KVStore[E]) Delete(entity E) error
- func (kvstore *KVStore[E]) ForEachPage(pageQuery datastore.PageQuery, pagerProcFunc datastore.PagerProcFunc[E], ...) error
- func (kvstore *KVStore[E]) Get(id uint64, CONSISTENCY_LEVEL int) (E, error)
- func (kvstore *KVStore[E]) Page(pageQuery datastore.PageQuery, CONSISTENCY_LEVEL int) (datastore.PageResult[E], error)
- func (kvstore *KVStore[E]) Save(entity E) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidReadBufferSize = errors.New("kvstore/afero: invalid read buffer size")
)
View Source
var (
ErrRecordNotFound = errors.New("datastore/kvstore: record not found")
)
Functions ¶
func New ¶
func New[E any]( logger *logging.Logger, dao datastore.GenericDAO[E]) datastore.GenericDAO[E]
func NewAferoDAO ¶
func NewAferoDAO[E any](logger *logging.Logger, fs afero.Fs, rootDir string, partition string, serializer datastore.Serializer, readBufferSize int) (datastore.GenericDAO[E], error)
Creates a key/value blob storage backend
Types ¶
type AferoDAO ¶
type AferoDAO[E any] struct { datastore.GenericDAO[E] // contains filtered or unexported fields }
func (*AferoDAO[E]) Count ¶
Returns the number of items in the blob store partition using a buffered read
func (*AferoDAO[E]) Delete ¶
Deletes the provided entity from the blob datastore. Returns an error if the provided entity can't be found.
func (*AferoDAO[E]) ForEachPage ¶
func (aferoDAO *AferoDAO[E]) ForEachPage( pageQuery datastore.PageQuery, pagerProcFunc datastore.PagerProcFunc[E], CONSISTENCY_LEVEL int) error
Reads all records in batches of PageQuery.PageSize, passing each page to the provided pageProcFunc to process the resultset.
func (*AferoDAO[E]) Get ¶
Retrieves the entity with the provided ID from the blob datastore. Returns an error if the entity can't be found or if it can't be unmarshalled.
Click to show internal directories.
Click to hide internal directories.