Documentation ¶
Index ¶
- Variables
- type Database
- func (db *Database) AddFileTag(fileId, tagId uint) (*entities.FileTag, error)
- func (db *Database) AddFileTags(fileId uint, tagIds []uint) error
- func (db Database) AddImplication(tagId, impliedTagId uint) error
- func (db *Database) Close() error
- func (db *Database) CopyFileTags(sourceTagId uint, destTagId uint) error
- func (db Database) CreateSchema() error
- func (db *Database) DeleteFile(fileId uint) error
- func (db *Database) DeleteFileTag(fileId, tagId uint) error
- func (db *Database) DeleteFileTagsByFileId(fileId uint) error
- func (db *Database) DeleteFileTagsByTagId(tagId uint) error
- func (db Database) DeleteImplication(tagId, impliedTagId uint) error
- func (db Database) DeleteImplicationsForTagId(tagId uint) error
- func (db *Database) DeleteQuery(text string) error
- func (db Database) DeleteTag(tagId uint) error
- func (db *Database) DuplicateFiles() ([]entities.Files, error)
- func (db *Database) File(id uint) (*entities.File, error)
- func (db *Database) FileByPath(path string) (*entities.File, error)
- func (db *Database) FileCount() (uint, error)
- func (db *Database) FileCountByFingerprint(fingerprint fingerprint.Fingerprint) (uint, error)
- func (db *Database) FileCountWithTag(tagId uint) (uint, error)
- func (db *Database) FileCountWithTags(tagIds []uint) (uint, error)
- func (db *Database) FileTagCount() (uint, error)
- func (db *Database) FileTagCountByFileId(fileId uint) (uint, error)
- func (db *Database) FileTagCountByTagId(tagId uint) (uint, error)
- func (db *Database) FileTagExists(fileId, tagId uint) (bool, error)
- func (db *Database) FileTags() (entities.FileTags, error)
- func (db *Database) FileTagsByFileId(fileId uint) (entities.FileTags, error)
- func (db *Database) FileTagsByTagId(tagId uint) (entities.FileTags, error)
- func (db *Database) Files() (entities.Files, error)
- func (db *Database) FilesByDirectory(path string) (entities.Files, error)
- func (db *Database) FilesByFingerprint(fingerprint fingerprint.Fingerprint) (entities.Files, error)
- func (db *Database) FilesWithTag(tagId uint) (entities.Files, error)
- func (db *Database) FilesWithTags(includeTagIds []uint, excludeTagIds []uint) (entities.Files, error)
- func (db *Database) Implications() (entities.Implications, error)
- func (db *Database) ImplicationsForTags(tagIds []uint) (entities.Implications, error)
- func (db *Database) InsertFile(path string, fingerprint fingerprint.Fingerprint, modTime time.Time, ...) (*entities.File, error)
- func (db *Database) InsertQuery(text string) (*entities.Query, error)
- func (db Database) InsertTag(name string) (*entities.Tag, error)
- func (db *Database) Queries() (entities.Queries, error)
- func (db *Database) Query(text string) (*entities.Query, error)
- func (db *Database) QueryFiles(expression query.Expression) (entities.Files, error)
- func (db Database) RenameTag(tagId uint, name string) (*entities.Tag, error)
- func (db Database) Tag(id uint) (*entities.Tag, error)
- func (db Database) TagByName(name string) (*entities.Tag, error)
- func (db *Database) TagCount() (uint, error)
- func (db Database) Tags() (entities.Tags, error)
- func (db *Database) TagsByFileId(fileId uint) (entities.Tags, error)
- func (db Database) TagsByNames(names []string) (entities.Tags, error)
- func (db *Database) TopTags(count uint) ([]entities.TagFileCount, error)
- func (db *Database) UpdateFile(fileId uint, path string, fingerprint fingerprint.Fingerprint, ...) (*entities.File, error)
- func (db Database) UpdateImplicationsForTagId(implyingTagId, impliedTagId uint) error
- type SqlBuilder
Constants ¶
This section is empty.
Variables ¶
var Path string
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) AddFileTag ¶
Adds a file tag.
func (*Database) AddFileTags ¶
Adds a set of file tags.
func (Database) AddImplication ¶ added in v0.2.0
Adds the specified implications
func (*Database) CopyFileTags ¶
Copies file tags from one tag to another.
func (Database) CreateSchema ¶
func (*Database) DeleteFile ¶
Removes a file from the database.
func (*Database) DeleteFileTag ¶
Removes an file tag.
func (*Database) DeleteFileTagsByFileId ¶
Removes all of the file tags for the specified file.
func (*Database) DeleteFileTagsByTagId ¶
Removes all of the file tags for the specified tag.
func (Database) DeleteImplication ¶ added in v0.2.0
Deletes the specified implications
func (Database) DeleteImplicationsForTagId ¶ added in v0.2.0
Deletes implications featuring the specified tag.
func (*Database) DeleteQuery ¶ added in v0.3.0
Removes a query from the database.
func (*Database) DuplicateFiles ¶
Retrieves the sets of duplicate files within the database.
func (*Database) FileByPath ¶
Retrieves the file with the specified path.
func (*Database) FileCountByFingerprint ¶
func (db *Database) FileCountByFingerprint(fingerprint fingerprint.Fingerprint) (uint, error)
Retrieves the number of files with the specified fingerprint.
func (*Database) FileCountWithTag ¶
Retrieves the count of files with the specified tag.
func (*Database) FileCountWithTags ¶
Retrieves the count of files with the specified tags.
func (*Database) FileTagCount ¶
Retrieves the total count of file tags in the database.
func (*Database) FileTagCountByFileId ¶
Retrieves the count of file tags for the specified file.
func (*Database) FileTagCountByTagId ¶ added in v0.3.0
Retrieves the count of file tags for the specified tag.
func (*Database) FileTagExists ¶
Determines whether the specified file has the specified tag applied.
func (*Database) FileTagsByFileId ¶
Retrieves the set of file tags with the specified file ID.
func (*Database) FileTagsByTagId ¶
Retrieves the set of file tags with the specified tag ID.
func (*Database) FilesByDirectory ¶
Retrieves all files that are under the specified directory.
func (*Database) FilesByFingerprint ¶
func (db *Database) FilesByFingerprint(fingerprint fingerprint.Fingerprint) (entities.Files, error)
Retrieves the set of files with the specified fingerprint.
func (*Database) FilesWithTag ¶
Retrieves the set of files with the specified tag.
func (*Database) FilesWithTags ¶
func (db *Database) FilesWithTags(includeTagIds []uint, excludeTagIds []uint) (entities.Files, error)
Retrieves the set of files with the specified tags.
func (*Database) Implications ¶ added in v0.2.0
func (db *Database) Implications() (entities.Implications, error)
Retrieves the complete set of tag implications.
func (*Database) ImplicationsForTags ¶ added in v0.2.0
func (db *Database) ImplicationsForTags(tagIds []uint) (entities.Implications, error)
Retrieves the set of tags implied by the specified tags.
func (*Database) InsertFile ¶
func (db *Database) InsertFile(path string, fingerprint fingerprint.Fingerprint, modTime time.Time, size int64, isDir bool) (*entities.File, error)
Adds a file to the database.
func (*Database) InsertQuery ¶ added in v0.3.0
Adds a query to the database.
func (*Database) QueryFiles ¶ added in v0.3.0
Retrieves the set of files matching the specified query.
func (*Database) TagsByFileId ¶
Retrieves the set of tags for the specified file.
func (Database) TagsByNames ¶
Retrieves the set of named tags.
func (*Database) TopTags ¶ added in v0.3.0
func (db *Database) TopTags(count uint) ([]entities.TagFileCount, error)
Retrieves the most popular tags.
func (*Database) UpdateFile ¶
func (db *Database) UpdateFile(fileId uint, path string, fingerprint fingerprint.Fingerprint, modTime time.Time, size int64, isDir bool) (*entities.File, error)
Updates a file in the database.
func (Database) UpdateImplicationsForTagId ¶ added in v0.2.0
Updates implications featuring the specified tag.
type SqlBuilder ¶ added in v0.3.0
type SqlBuilder struct { Sql string Params []interface{} // contains filtered or unexported fields }
func NewBuilder ¶ added in v0.3.0
func NewBuilder() *SqlBuilder
func (*SqlBuilder) AppendParam ¶ added in v0.3.0
func (builder *SqlBuilder) AppendParam(value interface{})
func (*SqlBuilder) AppendSql ¶ added in v0.3.0
func (builder *SqlBuilder) AppendSql(sql string)