Documentation ¶
Index ¶
- type DB
- func (db *DB) AddBackupBucket(bucket string) error
- func (db *DB) AddTagGroup(group *TagGroup) error
- func (db *DB) AllFiles() (files []*File, err error)
- func (db *DB) AllFilesWithoutTags() ([]*File, error)
- func (db *DB) AllImages() (files []*File, err error)
- func (db *DB) CheckBeforeDeleteTag(tagName string) error
- func (db *DB) CheckFilesHash(bucket string) error
- func (db *DB) Close() error
- func (db *DB) CurrentFileID() (string, error)
- func (db *DB) DamagedFileIDs() ([]string, error)
- func (db *DB) DamagedFiles() ([]*File, error)
- func (db *DB) DeleteBackupBucket(i int) error
- func (db *DB) DeleteFile(id string) error
- func (db *DB) DeletedFiles() (files []*File, err error)
- func (db *DB) Exec(query string, args ...interface{}) (err error)
- func (db *DB) FileHash(id string) (string, error)
- func (db *DB) ForceCheckFilesHash(bucket string) error
- func (db *DB) GetAllTags(query string) (tags []Tag, err error)
- func (db *DB) GetBackupBuckets() ([]string, error)
- func (db *DB) GetBackupFolder(i int) (string, error)
- func (db *DB) GetFileID(hash string) (id string, ok bool)
- func (db *DB) GetFileIDsByName(name string) ([]string, error)
- func (db *DB) GetFileName(id string) (string, error)
- func (db *DB) GetGroupsByTag(name string) (groups [][]string, err error)
- func (db *DB) GetInfo() (Info, error)
- func (db *DB) GetNextFileID() string
- func (db *DB) GetTagsByFile(id string) ([]string, error)
- func (db *DB) InsertFiles(files []*File) error
- func (db *DB) IsFileExist(id string) bool
- func (db *DB) IsTagExist(name string) (bool, error)
- func (db *DB) NewFile() *File
- func (db *DB) Open(dbPath string, cfg config.Config) (err error)
- func (db *DB) OpenBackup(dbPath string, cfg config.Config) (err error)
- func (db *DB) RecheckFile(folder string, file *File) (damaged bool, err error)
- func (db *DB) RenameFiles(id, name string) error
- func (db *DB) RenameTag(oldName, newName string) error
- func (db *DB) ReplaceFile(file *File) error
- func (db *DB) SearchDamagedFiles() ([]*File, error)
- func (db *DB) SearchFileName(pattern string, fileType string) (files []*File, err error)
- func (db *DB) SearchSameNameFiles(id string) ([]*File, error)
- func (db *DB) SearchTags(tags []string, fileType string) ([]*File, error)
- func (db *DB) TagGroups() (groups []TagGroup, err error)
- func (db *DB) TotalSize() (int64, error)
- func (db *DB) UpdateLastBackupNow() error
- func (db *DB) UpdateTags(fileID string, tags []string) error
- type File
- type Info
- type Row
- type Set
- type ShortID
- type Stmt
- type TX
- type Tag
- type TagGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB 数据库
func (*DB) AddBackupBucket ¶
func (*DB) AddTagGroup ¶
func (*DB) AllFilesWithoutTags ¶
func (*DB) CheckBeforeDeleteTag ¶
func (*DB) CheckFilesHash ¶
CheckFilesHash 只校验长时间未校验的文件,忽略短期内曾校验过的文件。 每次只校验有限的文件,避免校验耗时太长。
func (*DB) CurrentFileID ¶
func (*DB) DamagedFileIDs ¶
func (*DB) DamagedFiles ¶
func (*DB) DeleteBackupBucket ¶
func (*DB) DeleteFile ¶
func (*DB) DeletedFiles ¶
func (*DB) ForceCheckFilesHash ¶
ForceCheckFilesHash 不检查上次校验日期,强制校验全部文件。
func (*DB) GetBackupBuckets ¶
func (*DB) GetGroupsByTag ¶
func (*DB) GetNextFileID ¶
func (*DB) InsertFiles ¶
func (*DB) IsFileExist ¶
func (*DB) OpenBackup ¶
OpenBackup opens a backup database.
func (*DB) RecheckFile ¶
注意这里的 folder 与 db 匹配, db 与 file 必须分别属于不同的仓库,进行对比。 即,如果 db 是主仓库,则 file 应属于备份仓库; 如果 db 是备份仓库,则 file 应属于主仓库。
func (*DB) RenameFiles ¶
RenameFiles 统一修改全部同名文件的文件名。
func (*DB) ReplaceFile ¶
func (*DB) SearchDamagedFiles ¶
func (*DB) SearchFileName ¶
func (*DB) UpdateLastBackupNow ¶
type Info ¶
type Info struct { BucketLocation string LastChecked int64 LastBackup int64 AllFilesCount int64 DamagedFilesCount int64 FilesWaitingCheck int64 TotalSize int64 }
Info of the database
Click to show internal directories.
Click to hide internal directories.