persistence

package
v0.0.0-...-8247e04 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashDB

type HashDB struct {
	// contains filtered or unexported fields
}

func CreateInMemory

func CreateInMemory() (*HashDB, error)

func (*HashDB) DeleteFilesWithLastCheckTimestampBefore

func (db *HashDB) DeleteFilesWithLastCheckTimestampBefore(ctx context.Context, cutoffTime time.Time) error

func (*HashDB) GetFileCount

func (db *HashDB) GetFileCount(ctx context.Context) (int, error)

func (*HashDB) GetLastCheckTimestamp

func (db *HashDB) GetLastCheckTimestamp(ctx context.Context, path string) (time.Time, error)

func (*HashDB) GetPathForHash

func (db *HashDB) GetPathForHash(ctx context.Context, hash []byte) (string, error)

func (*HashDB) GetPathForHashHexString

func (db *HashDB) GetPathForHashHexString(ctx context.Context, hash string) (string, error)

func (*HashDB) HaveHash

func (db *HashDB) HaveHash(ctx context.Context, hash []byte) bool

func (*HashDB) HaveHashHexString

func (db *HashDB) HaveHashHexString(ctx context.Context, hash string) bool

func (*HashDB) ListAll

func (db *HashDB) ListAll(ctx context.Context) ([]HashSet, error)

func (*HashDB) UpsertFileHash

func (db *HashDB) UpsertFileHash(ctx context.Context, path string, hash []byte) error

type HashSet

type HashSet struct {
	Path              string
	Hash              []byte
	LastHashTimestamp string
}

Jump to

Keyboard shortcuts

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