dbx

package
v0.0.0-...-95c80d3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SuperScanRootDirID is scan root dir id for scan root dir entry in DB
	SuperScanRootDirID = 0
)

Variables

View Source
var (
	ErrMaxRetry = errors.New("Beyond max retry")
)

Functions

func IsErrNoRow

func IsErrNoRow(err error) bool

IsNoRow check the error is no row or not

Types

type DB

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

func OpenDB

func OpenDB(filename string) (*DB, error)

OpenDB opens db with given filename.

func (*DB) CreateIsoWithFileIDs

func (db *DB) CreateIsoWithFileIDs(iso *types.ISOInfo, fileIDs string) (int, int, error)

func (*DB) DeleteBatchFiles

func (db *DB) DeleteBatchFiles(fileIDs string) (int, error)

func (*DB) DeletePartsByIsoID

func (db *DB) DeletePartsByIsoID(isoID int) error

func (*DB) GetDirIDByPathAndRootID

func (db *DB) GetDirIDByPathAndRootID(path string, scanRootDirID int) (*int, error)

func (*DB) GetFileByNameAndDirID

func (db *DB) GetFileByNameAndDirID(name string, dirID int) (*types.FileInfo, error)

func (*DB) GetIsoByName

func (db *DB) GetIsoByName(name string) (*types.ISOInfo, error)

func (*DB) GetPartsByIsoID

func (db *DB) GetPartsByIsoID(isoID int) (parts []*types.PartInfo, err error)

func (*DB) GetTotalFilesInIso

func (db *DB) GetTotalFilesInIso(isoID int) (uint64, uint64, error)

func (*DB) InsertDir

func (db *DB) InsertDir(path string, scanRootDirID int, modTime *time.Time) (int, error)

func (*DB) InsertFile

func (db *DB) InsertFile(f *types.FileInfo) (int, error)

func (*DB) InsertISO

func (db *DB) InsertISO(iso *types.ISOInfo) (int, error)

func (*DB) InsertIsoParts

func (db *DB) InsertIsoParts(isoID int, parts []*types.PartInfo) error

func (*DB) ListDirs

func (db *DB) ListDirs() (map[int]*types.DirInfo, error)

func (*DB) ListFilesBySize

func (db *DB) ListFilesBySize(minFileSize int) ([]*types.FileInfo, error)

func (*DB) ListFilesNotInISOAndCloud

func (db *DB) ListFilesNotInISOAndCloud() ([]*types.FileInfo, error)

func (*DB) ListFilesNotInISOOrCloud

func (db *DB) ListFilesNotInISOOrCloud() ([]*types.FileInfo, error)

func (*DB) ListISOs

func (db *DB) ListISOs() ([]*types.ISOInfo, error)

func (*DB) ListScanRootDirs

func (db *DB) ListScanRootDirs() (map[int]string, error)

func (*DB) ResetISOUploadInfo

func (db *DB) ResetISOUploadInfo(isoFilename string) error

func (*DB) TotalFileSizeNotInISO

func (db *DB) TotalFileSizeNotInISO() (uint64, error)

func (*DB) UpdateDirModTime

func (db *DB) UpdateDirModTime(dirID int, modTime time.Time) error

func (*DB) UpdateFileIsoIDAndRemoteHash

func (db *DB) UpdateFileIsoIDAndRemoteHash(isoID, fileID int, remoteHash string) error

func (*DB) UpdateIsoRemoteHash

func (db *DB) UpdateIsoRemoteHash(isoID int, hash string) error

func (*DB) UpdateIsoStatus

func (db *DB) UpdateIsoStatus(isoID int, status types.IsoStatus) error

func (*DB) UpdateIsoStatusRemoteHash

func (db *DB) UpdateIsoStatusRemoteHash(isoID int, remoteHash string, status types.IsoStatus) error

func (*DB) UpdateIsoUploadInfo

func (db *DB) UpdateIsoUploadInfo(info *types.ISOInfo) error

func (*DB) UpdatePartEtagAndStatus

func (db *DB) UpdatePartEtagAndStatus(isoID, partNo int, etag string, status types.PartStatus) error

func (*DB) UpdatePartEtagAndStatusHash

func (db *DB) UpdatePartEtagAndStatusHash(isoID, partNo int, etag, localHash, remoteHash string, status types.PartStatus) error

func (*DB) UpdatePartStatus

func (db *DB) UpdatePartStatus(isoID, partNo int, status types.PartStatus) error

Jump to

Keyboard shortcuts

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