Documentation ¶
Index ¶
- func CommitAndRollback(tx *sql.Tx, err error) error
- func New(dataSourceName string) (dao.Database, error)
- type DB
- func (db *DB) BranchCount(ctx context.Context) (int, error)
- func (db *DB) BranchInfo(ctx context.Context, branchName string) (branch dao.Branch, err error)
- func (db *DB) BranchList(ctx context.Context) (branches []dao.IBranch, err error)
- func (db *DB) CheckExists(ctx context.Context, driverId uint64, dirPath []string, ...) error
- func (db *DB) Close() error
- func (db *DB) Create() error
- func (db *DB) DataSourceName() string
- func (db *DB) DeleteBranch(ctx context.Context, branchName string) error
- func (db *DB) DeleteDevice(ctx context.Context, deviceId string) error
- func (db *DB) DeleteDriver(ctx context.Context, driverId uint64) error
- func (db *DB) DirCount(ctx context.Context) (int, error)
- func (db *DB) DirItemCount(ctx context.Context) (int, error)
- func (db *DB) FileCount(ctx context.Context) (int, error)
- func (db *DB) GetDriver(ctx context.Context, driverId uint64) (driver dao.Driver, err error)
- func (db *DB) GetDriverDirCalculatedInfo(ctx context.Context, driverId uint64, filePath []string) (info dao.DirCalculatedInfo, err error)
- func (db *DB) GetDriverFile(ctx context.Context, driverId uint64, filePath []string) (file dao.DriverFile, err error)
- func (db *DB) GetDriverLocalFile(ctx context.Context, driverId uint64) (driver *dao.Driver, err error)
- func (db *DB) GetDriverSync(ctx context.Context, driverId uint64) (driver dao.Driver, err error)
- func (db *DB) GetDriverToken(ctx context.Context, driverId uint64) (driver dao.Driver, err error)
- func (db *DB) GetEarliestCrated(ctx context.Context, hash string) (t int64, err error)
- func (db *DB) GetFileHashMode(ctx context.Context, branchName string, splitPath []string) (hash string, mode os.FileMode, err error)
- func (db *DB) GetFileType(ctx context.Context, hash string) (fileType dao.FileType, err error)
- func (db *DB) GetLivePhotoByLivp(ctx context.Context, livpHash string) (movHash string, heicHash string, err error)
- func (db *DB) GetMetadata(ctx context.Context, hash string) (metadata dao.Metadata, err error)
- func (db *DB) InsertBranchWithTxOrDb(ctx context.Context, txOrDb dbBase.TxOrDb, branch dao.Branch) error
- func (db *DB) InsertCommitWithTxOrDb(ctx context.Context, txOrDb dbBase.TxOrDb, commit *dao.Commit) error
- func (db *DB) InsertDCIMMetadataTime(ctx context.Context, hash string, t int64) (exist bool, err error)
- func (db *DB) InsertDevice(ctx context.Context, id string, name string, os string, userAgent string, ...) error
- func (db *DB) InsertDriver(ctx context.Context, driverName string, description string) (exist bool, err error)
- func (db *DB) InsertDriverBaiduPhoto(ctx context.Context, driverName string, description string, accessToken string, ...) (exist bool, err error)
- func (db *DB) InsertDriverLocalFile(ctx context.Context, driverName string, description string, deviceId string, ...) (exist bool, err error)
- func (db *DB) InsertExif(ctx context.Context, hash string, e dao.Exif) (exist bool, err error)
- func (db *DB) InsertFile(ctx context.Context, hash string, size uint64) error
- func (db *DB) InsertFileMd5(ctx context.Context, hash string, hashMd5 string) error
- func (db *DB) InsertFileType(ctx context.Context, hash string, t dao.FileType) (exist bool, err error)
- func (db *DB) InsertHeightWidth(ctx context.Context, hash string, hw dao.HeightWidth) error
- func (db *DB) InsertNullExif(ctx context.Context, hash string) (exist bool, err error)
- func (db *DB) InsertNullVideoMetadata(ctx context.Context, hash string) (exist bool, err error)
- func (db *DB) InsertVideoMetadata(ctx context.Context, hash string, m dao.VideoMetadata) (exist bool, err error)
- func (db *DB) IsSqlite() bool
- func (db *DB) IsUniqueConstraintError(err error) bool
- func (db *DB) List(ctx context.Context, branchName string, splitPath []string) (dirItems []dao.DirItem, err error)
- func (db *DB) ListByHash(ctx context.Context, hash string) (dirItems []dao.DirItem, err error)
- func (db *DB) ListCloudDriverSync(ctx context.Context) (drivers []dao.Driver, err error)
- func (db *DB) ListDCIMDriver(ctx context.Context) (drivers []dao.DCIMDriver, err error)
- func (db *DB) ListDCIMLocation(ctx context.Context) (list []dao.Metadata, err error)
- func (db *DB) ListDCIMMediaType(ctx context.Context) (m map[string][]dao.Metadata, err error)
- func (db *DB) ListDCIMSearchSuffix(ctx context.Context) (list []dao.DCIMSearchSuffix, err error)
- func (db *DB) ListDCIMSearchType(ctx context.Context) (list []dao.DCIMSearchType, err error)
- func (db *DB) ListDevice(ctx context.Context) (devices []dao.Device, err error)
- func (db *DB) ListDriver(ctx context.Context) (drivers []dao.Driver, err error)
- func (db *DB) ListDriverFile(ctx context.Context, driverId uint64, filePath []string) (files []dao.DriverFile, err error)
- func (db *DB) ListDriverFileByHash(ctx context.Context, hash string) (files []dao.DriverFile, err error)
- func (db *DB) ListExif(ctx context.Context) (exifMap map[string]dao.Exif, err error)
- func (db *DB) ListExpectExif(ctx context.Context) (hashList []string, err error)
- func (db *DB) ListExpectExifCb(ctx context.Context, cb func(hash string)) (err error)
- func (db *DB) ListExpectFileType(ctx context.Context) (hashList []string, err error)
- func (db *DB) ListFile(ctx context.Context) (hashList []string, err error)
- func (db *DB) ListFileHash(ctx context.Context) (hashList []string, err error)
- func (db *DB) ListFileMd5(ctx context.Context, md5List []string) (m map[string]string, err error)
- func (db *DB) ListLivePhotoAll(ctx context.Context) (hashList []string, err error)
- func (db *DB) ListLivePhotoNew(ctx context.Context) (hashList []string, err error)
- func (db *DB) ListLocalFileDriver(ctx context.Context, deviceId string) (drivers []dao.Driver, err error)
- func (db *DB) ListMetadata(ctx context.Context) (list []dao.Metadata, err error)
- func (db *DB) ListMetadataTime(ctx context.Context) (list []dao.Metadata, err error)
- func (db *DB) MaxBatchSize() int
- func (db *DB) NewBranch(ctx context.Context, branchName string) (exist bool, err error)
- func (db *DB) Open(ctx context.Context, branchName string, splitPath []string) (hash string, mode os.FileMode, dirItems []dao.DirItem, err error)
- func (db *DB) Open2(ctx context.Context, branchName string, splitPath []string) (dirItem dao.DirItem, dirItems []dao.DirItem, err error)
- func (db *DB) Remove() error
- func (db *DB) RemoveDirItem(ctx context.Context, branchName string, splitPath []string) (commit dao.Commit, branch dao.Branch, err error)
- func (db *DB) ResetBranch(ctx context.Context, branchName string) (err error)
- func (db *DB) ResetDriver(ctx context.Context, driverId uint64) error
- func (db *DB) SearchDCIM(ctx context.Context, typeList []string, suffixList []string) (list []dao.Metadata, err error)
- func (db *DB) SetLivpForMovAndHeicOrJpgAll(ctx context.Context) error
- func (db *DB) SetLivpForMovAndHeicOrJpgInDirPath(ctx context.Context, driverId uint64, filePath []string) (err error)
- func (db *DB) SetLivpForMovAndHeicOrJpgInDriver(ctx context.Context, driverId uint64) (err error)
- func (db *DB) Size() (int64, error)
- func (db *DB) SumFileSize(ctx context.Context) (size uint64, err error)
- func (db *DB) UpdateDriverLocalFile(ctx context.Context, driverId uint64, srcPath, ignores, encoder string) error
- func (db *DB) UpdateDriverSync(ctx context.Context, driverId uint64, sync bool, h int64, m int64) error
- func (db *DB) UpsertBranchWithTxOrDb(ctx context.Context, txOrDb dbBase.TxOrDb, branch dao.Branch) error
- func (db *DB) UpsertDCIMMetadataTime(ctx context.Context, hash string, t int64) error
- func (db *DB) UpsertDirItem(ctx context.Context, branchName string, splitPath []string, item dao.DirItem) (commit dao.Commit, branch dao.Branch, err error)
- func (db *DB) UpsertDirItems(ctx context.Context, branchName string, splitPath []string, ...) (commit dao.Commit, branch dao.Branch, err error)
- func (db *DB) UpsertDriverFile(ctx context.Context, f dao.DriverFile, mkdir bool) error
- func (db *DB) UpsertDriverFiles(ctx context.Context, files []dao.DriverFile) error
- func (db *DB) UpsertFileType(ctx context.Context, hash string, t dao.FileType) error
- func (db *DB) UpsertLivePhoto(ctx context.Context, movHash string, heicHash string, jpgHash string, ...) error
- func (db *DB) WriteBranch(ctx context.Context, branch dao.Branch) error
- func (db *DB) WriteCommit(ctx context.Context, commit *dao.Commit) error
- func (db *DB) WriteDir(ctx context.Context, dirItems []dao.DirItem) (dir dao.Dir, err error)
- func (db *DB) WriteFile(ctx context.Context, file dao.File) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) BranchInfo ¶
func (*DB) BranchList ¶
func (*DB) CheckExists ¶
func (*DB) DataSourceName ¶
func (*DB) GetDriverDirCalculatedInfo ¶
func (*DB) GetDriverFile ¶
func (*DB) GetDriverLocalFile ¶
func (*DB) GetDriverSync ¶
func (*DB) GetDriverToken ¶
func (*DB) GetEarliestCrated ¶
func (*DB) GetFileHashMode ¶
func (*DB) GetFileType ¶
func (*DB) GetLivePhotoByLivp ¶
func (*DB) GetMetadata ¶
func (*DB) InsertBranchWithTxOrDb ¶
func (*DB) InsertCommitWithTxOrDb ¶
func (*DB) InsertDCIMMetadataTime ¶
func (*DB) InsertDevice ¶
func (*DB) InsertDriver ¶
func (*DB) InsertDriverBaiduPhoto ¶
func (*DB) InsertDriverLocalFile ¶
func (*DB) InsertExif ¶
func (*DB) InsertFile ¶
func (*DB) InsertFileMd5 ¶
func (*DB) InsertFileType ¶
func (*DB) InsertHeightWidth ¶
func (*DB) InsertNullExif ¶
func (*DB) InsertNullVideoMetadata ¶
func (*DB) InsertVideoMetadata ¶
func (*DB) IsUniqueConstraintError ¶
func (*DB) ListByHash ¶
func (*DB) ListCloudDriverSync ¶
func (*DB) ListDCIMDriver ¶
func (*DB) ListDCIMLocation ¶
func (*DB) ListDCIMMediaType ¶
func (*DB) ListDCIMSearchSuffix ¶
func (*DB) ListDCIMSearchType ¶
func (*DB) ListDevice ¶
func (*DB) ListDriver ¶
func (*DB) ListDriverFile ¶
func (*DB) ListDriverFileByHash ¶
func (*DB) ListExpectExif ¶
func (*DB) ListExpectExifCb ¶
func (*DB) ListExpectFileType ¶
func (*DB) ListFileHash ¶
func (*DB) ListFileMd5 ¶
func (*DB) ListLivePhotoAll ¶
func (*DB) ListLivePhotoNew ¶
func (*DB) ListLocalFileDriver ¶
func (*DB) ListMetadata ¶
func (*DB) ListMetadataTime ¶
func (*DB) MaxBatchSize ¶
func (*DB) RemoveDirItem ¶
func (*DB) ResetBranch ¶
func (*DB) SearchDCIM ¶
func (*DB) SetLivpForMovAndHeicOrJpgAll ¶
func (*DB) SetLivpForMovAndHeicOrJpgInDirPath ¶
func (*DB) SetLivpForMovAndHeicOrJpgInDriver ¶
func (*DB) UpdateDriverLocalFile ¶
func (*DB) UpdateDriverSync ¶
func (*DB) UpsertBranchWithTxOrDb ¶
func (*DB) UpsertDCIMMetadataTime ¶
func (*DB) UpsertDirItem ¶
func (*DB) UpsertDirItems ¶
func (*DB) UpsertDriverFile ¶
func (*DB) UpsertDriverFiles ¶
func (*DB) UpsertFileType ¶
func (*DB) UpsertLivePhoto ¶
Click to show internal directories.
Click to hide internal directories.