Documentation ¶
Index ¶
- func Iterate[T any](d *DocumentDao, prefix string, handler func(result *IteratorResult) error) error
- func ScanDirectory(root string, config *ScanConfiguration, handler func(result *ScanResult), ...)
- type DocumentDao
- func (d *DocumentDao) Close() error
- func (d *DocumentDao) Count(prefix string) (int, error)
- func (d *DocumentDao) DeleteRecord(key string) error
- func (d *DocumentDao) GetRecord(key string, destination any) error
- func (d *DocumentDao) GetRecords(prefix string, destination any) error
- func (d *DocumentDao) SetRecord(key string, record any) error
- func (d *DocumentDao) SetRecordsBatch(recordsBatch []struct{ ... }) error
- type IteratorResult
- type ScanConfiguration
- type ScanResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Iterate ¶
func Iterate[T any](d *DocumentDao, prefix string, handler func(result *IteratorResult) error) error
Not defined as a method in order to use generics https://github.com/golang/go/issues/48793#issuecomment-1079910818
func ScanDirectory ¶
func ScanDirectory(root string, config *ScanConfiguration, handler func(result *ScanResult), onComplete func(int, error))
Types ¶
type DocumentDao ¶
type DocumentDao struct {
// contains filtered or unexported fields
}
func NewDocumentDao ¶
func NewDocumentDao(persistenceDirectory string) (*DocumentDao, error)
func (*DocumentDao) Close ¶
func (d *DocumentDao) Close() error
func (*DocumentDao) DeleteRecord ¶
func (d *DocumentDao) DeleteRecord(key string) error
func (*DocumentDao) GetRecords ¶
func (d *DocumentDao) GetRecords(prefix string, destination any) error
func (*DocumentDao) SetRecordsBatch ¶
func (d *DocumentDao) SetRecordsBatch(recordsBatch []struct { Key string Record any }) error
type IteratorResult ¶
func (*IteratorResult) Delete ¶
func (r *IteratorResult) Delete() error
type ScanConfiguration ¶
type ScanConfiguration struct { EmitDirectories bool // contains filtered or unexported fields }
func (*ScanConfiguration) AddExtensions ¶
func (c *ScanConfiguration) AddExtensions(extensions ...string)
Click to show internal directories.
Click to hide internal directories.