data_store

package module
v0.0.0-...-a61834f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 9 Imported by: 2

Documentation

Index

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) Count

func (d *DocumentDao) Count(prefix string) (int, error)

func (*DocumentDao) DeleteRecord

func (d *DocumentDao) DeleteRecord(key string) error

func (*DocumentDao) GetRecord

func (d *DocumentDao) GetRecord(key string, destination any) error

func (*DocumentDao) GetRecords

func (d *DocumentDao) GetRecords(prefix string, destination any) error

func (*DocumentDao) SetRecord

func (d *DocumentDao) SetRecord(key string, record any) error

func (*DocumentDao) SetRecordsBatch

func (d *DocumentDao) SetRecordsBatch(recordsBatch []struct {
	Key    string
	Record any
}) error

type IteratorResult

type IteratorResult struct {
	Key    string
	Record any
	// contains filtered or unexported fields
}

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)

type ScanResult

type ScanResult struct {
	AbsolutePath string
	Extension    string
	IsDir        bool
	RelativePath string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL