ftsdb

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: EUPL-1.2 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileTypeStatsDB

type FileTypeStatsDB struct {
	DB       *sql.DB
	IsOpened bool
	// contains filtered or unexported fields
}

func New

func New(file string, create bool) (*FileTypeStatsDB, error)

New returns a DB instance to the sqlite db in existing file or creates it if it doesn't exist and create==true

func (*FileTypeStatsDB) Close

func (f *FileTypeStatsDB) Close()

func (*FileTypeStatsDB) CommitBatch added in v0.8.0

func (f *FileTypeStatsDB) CommitBatch(batchBuffer *types.FTypeStatsBatch) error

func (*FileTypeStatsDB) DbFileName

func (f *FileTypeStatsDB) DbFileName() string

func (*FileTypeStatsDB) DeleteFileStats

func (f *FileTypeStatsDB) DeleteFileStats(path string) error

DeleteFileStats deletes the file/dir in path, if it's a dir, the delete is recursive

func (*FileTypeStatsDB) DeleteOlderThan

func (f *FileTypeStatsDB) DeleteOlderThan(t time.Time) error

DeleteOlderThan deletes all entries older than (i.e. not updated after) t

func (*FileTypeStatsDB) DeleteOlderThanWithPrefix

func (f *FileTypeStatsDB) DeleteOlderThanWithPrefix(t time.Time, prefix string) error

DeleteOlderThanWithPrefix deletes all entries older than (i.e. not updated after) t

func (*FileTypeStatsDB) FTDumpPaths added in v0.8.0

func (f *FileTypeStatsDB) FTDumpPaths(paths []string) (*[]types.FTypeStat, error)

FTDumpPaths returns all paths and raw info selected by the paths argument

func (*FileTypeStatsDB) FTStatsSum

func (f *FileTypeStatsDB) FTStatsSum(paths []string) (types.FileTypeStats, error)

FTStatsSum returns the summary FileTypeStats for the given paths as a map of FTypeStat per File Type

func (*FileTypeStatsDB) Open

func (f *FileTypeStatsDB) Open() error

func (*FileTypeStatsDB) UpdateFilePath

func (f *FileTypeStatsDB) UpdateFilePath(from, to string) error

UpdateFilePath updates the file path(s), which needs to happen on a file move if path is a dir the update is recursive

func (*FileTypeStatsDB) UpdateFileStats

func (f *FileTypeStatsDB) UpdateFileStats(path, filecat string, size uint64) error

UpdateFileStats upserts the file in path with size

func (*FileTypeStatsDB) UpdateFileStatsMulti added in v0.8.0

func (f *FileTypeStatsDB) UpdateFileStatsMulti(path, filecat string, size uint64, batchBuffer *types.FTypeStatsBatch) error

Jump to

Keyboard shortcuts

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