Documentation ¶
Index ¶
- func AddFileTag(tx *Tx, fileId entities.FileId, tagId entities.TagId, valueId entities.ValueId) (*entities.FileTag, error)
- func AddImplication(tx *Tx, pair, impliedPair entities.TagIdValueIdPair) error
- func CopyFileTags(tx *Tx, sourceTagId entities.TagId, destTagId entities.TagId) error
- func CreateAt(path string) error
- func DeleteFile(tx *Tx, fileId entities.FileId) error
- func DeleteFileTag(tx *Tx, fileId entities.FileId, tagId entities.TagId, valueId entities.ValueId) error
- func DeleteFileTagsByFileId(tx *Tx, fileId entities.FileId) error
- func DeleteFileTagsByTagId(tx *Tx, tagId entities.TagId) error
- func DeleteFileTagsByValueId(tx *Tx, valueId entities.ValueId) error
- func DeleteImplication(tx *Tx, pair, impliedPair entities.TagIdValueIdPair) error
- func DeleteImplicationsByTagId(tx *Tx, tagId entities.TagId) error
- func DeleteImplicationsByValueId(tx *Tx, valueId entities.ValueId) error
- func DeleteQuery(tx *Tx, text string) error
- func DeleteTag(tx *Tx, tagId entities.TagId) error
- func DeleteUntaggedFiles(tx *Tx, fileIds entities.FileIds) error
- func DeleteValue(tx *Tx, valueId entities.ValueId) error
- func DuplicateFiles(tx *Tx) ([]entities.Files, error)
- func File(tx *Tx, id entities.FileId) (*entities.File, error)
- func FileByPath(tx *Tx, path string) (*entities.File, error)
- func FileCount(tx *Tx) (uint, error)
- func FileCountByFingerprint(tx *Tx, fingerprint fingerprint.Fingerprint) (uint, error)
- func FileCountForQuery(tx *Tx, expression query.Expression, path string, ...) (uint, error)
- func FileTagCount(tx *Tx) (uint, error)
- func FileTagCountByFileId(tx *Tx, fileId entities.FileId) (uint, error)
- func FileTagCountByTagId(tx *Tx, tagId entities.TagId) (uint, error)
- func FileTagCountByValueId(tx *Tx, valueId entities.ValueId) (uint, error)
- func FileTagExists(tx *Tx, fileId entities.FileId, tagId entities.TagId, valueId entities.ValueId) (bool, error)
- func FileTags(tx *Tx) (entities.FileTags, error)
- func FileTagsByFileId(tx *Tx, fileId entities.FileId) (entities.FileTags, error)
- func FileTagsByTagId(tx *Tx, tagId entities.TagId) (entities.FileTags, error)
- func FileTagsByValueId(tx *Tx, valueId entities.ValueId) (entities.FileTags, error)
- func Files(tx *Tx, sort string) (entities.Files, error)
- func FilesByDirectory(tx *Tx, path string, pathContainsRoot bool) (entities.Files, error)
- func FilesByFingerprint(tx *Tx, fingerprint fingerprint.Fingerprint) (entities.Files, error)
- func FilesForQuery(tx *Tx, expression query.Expression, path string, ...) (entities.Files, error)
- func Implications(tx *Tx) (entities.Implications, error)
- func ImplicationsFor(tx *Tx, pairs entities.TagIdValueIdPairs) (entities.Implications, error)
- func ImplyingImplications(tx *Tx, pairs entities.TagIdValueIdPairs) (entities.Implications, error)
- func InsertFile(tx *Tx, path string, fingerprint fingerprint.Fingerprint, modTime time.Time, ...) (*entities.File, error)
- func InsertQuery(tx *Tx, text string) (*entities.Query, error)
- func InsertTag(tx *Tx, name string) (*entities.Tag, error)
- func InsertValue(tx *Tx, name string) (*entities.Value, error)
- func Queries(tx *Tx) (entities.Queries, error)
- func Query(tx *Tx, text string) (*entities.Query, error)
- func RenameTag(tx *Tx, tagId entities.TagId, name string) (*entities.Tag, error)
- func RenameValue(tx *Tx, valueId entities.ValueId, newName string) (*entities.Value, error)
- func Setting(tx *Tx, name string) (*entities.Setting, error)
- func Settings(tx *Tx) (entities.Settings, error)
- func Tag(tx *Tx, id entities.TagId) (*entities.Tag, error)
- func TagByName(tx *Tx, name string, ignoreCase bool) (*entities.Tag, error)
- func TagCount(tx *Tx) (uint, error)
- func TagUsage(tx *Tx) ([]entities.TagFileCount, error)
- func Tags(tx *Tx) (entities.Tags, error)
- func TagsByIds(tx *Tx, ids entities.TagIds) (entities.Tags, error)
- func TagsByNames(tx *Tx, names []string, ignoreCase bool) (entities.Tags, error)
- func UntaggedFiles(tx *Tx) (entities.Files, error)
- func UnusedValues(tx *Tx) (entities.Values, error)
- func UpdateFile(tx *Tx, fileId entities.FileId, path string, ...) (*entities.File, error)
- func UpdateSetting(tx *Tx, name, value string) (*entities.Setting, error)
- func Value(tx *Tx, id entities.ValueId) (*entities.Value, error)
- func ValueByName(tx *Tx, name string, ignoreCase bool) (*entities.Value, error)
- func ValueCount(tx *Tx) (uint, error)
- func Values(tx *Tx) (entities.Values, error)
- func ValuesByIds(tx *Tx, ids entities.ValueIds) (entities.Values, error)
- func ValuesByNames(tx *Tx, names []string, ignoreCase bool) (entities.Values, error)
- func ValuesByTagId(tx *Tx, tagId entities.TagId) (entities.Values, error)
- type Database
- type DatabaseAccessError
- type DatabaseNotFoundError
- type DatabaseQueryError
- type DatabaseTransactionError
- type NoSuchFileError
- type NoSuchFileTagError
- type NoSuchImplicationError
- type NoSuchQueryError
- type NoSuchSettingError
- type NoSuchValueError
- type SqlBuilder
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFileTag ¶
func AddFileTag(tx *Tx, fileId entities.FileId, tagId entities.TagId, valueId entities.ValueId) (*entities.FileTag, error)
Adds a file tag.
func AddImplication ¶
func AddImplication(tx *Tx, pair, impliedPair entities.TagIdValueIdPair) error
Adds the specified implications
func CopyFileTags ¶
Copies file tags from one tag to another.
func DeleteFile ¶
Removes a file from the database.
func DeleteFileTag ¶
func DeleteFileTag(tx *Tx, fileId entities.FileId, tagId entities.TagId, valueId entities.ValueId) error
Removes a file tag.
func DeleteFileTagsByFileId ¶
Removes all of the file tags for the specified file.
func DeleteFileTagsByTagId ¶
Removes all of the file tags for the specified tag.
func DeleteFileTagsByValueId ¶
Removes all of the file tags for the specified value.
func DeleteImplication ¶
func DeleteImplication(tx *Tx, pair, impliedPair entities.TagIdValueIdPair) error
Deletes the specified implication
func DeleteImplicationsByTagId ¶
Deletes implications for the specified tag id
func DeleteImplicationsByValueId ¶
Deletes implications for the specified value id
func DeleteUntaggedFiles ¶
Deletes the specified files if they are untagged
func DuplicateFiles ¶
Retrieves the sets of duplicate files within the database.
func FileByPath ¶
Retrieves the file with the specified path.
func FileCountByFingerprint ¶
func FileCountByFingerprint(tx *Tx, fingerprint fingerprint.Fingerprint) (uint, error)
Retrieves the number of files with the specified fingerprint.
func FileCountForQuery ¶
func FileCountForQuery(tx *Tx, expression query.Expression, path string, pathContainsRoot, explicitOnly, ignoreCase bool) (uint, error)
Retrieves the count of files matching the specified query and matching the specified path.
func FileTagCount ¶
Retrieves the total count of file tags in the database.
func FileTagCountByFileId ¶
Retrieves the count of file tags for the specified file.
func FileTagCountByTagId ¶
Retrieves the count of file tags for the specified tag.
func FileTagCountByValueId ¶
Retrieves the count of file tags for the specified value.
func FileTagExists ¶
func FileTagExists(tx *Tx, fileId entities.FileId, tagId entities.TagId, valueId entities.ValueId) (bool, error)
Determines whether the specified file has the specified tag applied.
func FileTagsByFileId ¶
Retrieves the set of file tags for the specified file.
func FileTagsByTagId ¶
Retrieves the set of file tags with the specified tag ID.
func FileTagsByValueId ¶
Retrieves the set of file tags with the specified value ID.
func FilesByDirectory ¶
Retrieves all files that are under the specified directory.
func FilesByFingerprint ¶
func FilesByFingerprint(tx *Tx, fingerprint fingerprint.Fingerprint) (entities.Files, error)
Retrieves the set of files with the specified fingerprint.
func FilesForQuery ¶
func FilesForQuery(tx *Tx, expression query.Expression, path string, pathContainsRoot, explicitOnly, ignoreCase bool, sort string) (entities.Files, error)
Retrieves the set of files matching the specified query and matching the specified path.
func Implications ¶
func Implications(tx *Tx) (entities.Implications, error)
Retrieves the complete set of tag implications.
func ImplicationsFor ¶
func ImplicationsFor(tx *Tx, pairs entities.TagIdValueIdPairs) (entities.Implications, error)
Retrieves the set of implications by the specified tag and value pairs.
func ImplyingImplications ¶
func ImplyingImplications(tx *Tx, pairs entities.TagIdValueIdPairs) (entities.Implications, error)
func InsertFile ¶
func InsertFile(tx *Tx, path string, fingerprint fingerprint.Fingerprint, modTime time.Time, size int64, isDir bool) (*entities.File, error)
Adds a file to the database.
func InsertQuery ¶
Adds a query to the database.
func RenameValue ¶
Renames a value.
func TagUsage ¶
func TagUsage(tx *Tx) ([]entities.TagFileCount, error)
Retrieves the usage of each tag
func TagsByNames ¶
Retrieves the set of named tags.
func UntaggedFiles ¶
Retrieves the set of untagged files.
func UnusedValues ¶
Retrieves the set of unused values.
func UpdateFile ¶
func UpdateFile(tx *Tx, fileId entities.FileId, path string, fingerprint fingerprint.Fingerprint, modTime time.Time, size int64, isDir bool) (*entities.File, error)
Updates a file in the database.
func ValueByName ¶
Retrieves a specific value by name.
func ValuesByIds ¶
Retrieves a specific set of values.
func ValuesByNames ¶
Retrieves the set of values with the specified names.
Types ¶
type DatabaseAccessError ¶
func (DatabaseAccessError) Error ¶
func (err DatabaseAccessError) Error() string
type DatabaseNotFoundError ¶
type DatabaseNotFoundError struct {
Path string
}
func (DatabaseNotFoundError) Error ¶
func (err DatabaseNotFoundError) Error() string
type DatabaseQueryError ¶
func (DatabaseQueryError) Error ¶
func (err DatabaseQueryError) Error() string
type DatabaseTransactionError ¶
func (DatabaseTransactionError) Error ¶
func (err DatabaseTransactionError) Error() string
type NoSuchFileError ¶
func (NoSuchFileError) Error ¶
func (err NoSuchFileError) Error() string
type NoSuchFileTagError ¶
type NoSuchFileTagError struct { FileId entities.FileId TagId entities.TagId ValueId entities.ValueId }
func (NoSuchFileTagError) Error ¶
func (err NoSuchFileTagError) Error() string
type NoSuchImplicationError ¶
type NoSuchImplicationError struct { TagValuePair entities.TagIdValueIdPair ImpliedTagValuePair entities.TagIdValueIdPair }
func (NoSuchImplicationError) Error ¶
func (err NoSuchImplicationError) Error() string
type NoSuchQueryError ¶
type NoSuchQueryError struct {
Query string
}
func (NoSuchQueryError) Error ¶
func (err NoSuchQueryError) Error() string
type NoSuchSettingError ¶
type NoSuchSettingError struct {
Name string
}
func (NoSuchSettingError) Error ¶
func (err NoSuchSettingError) Error() string
type NoSuchValueError ¶
func (NoSuchValueError) Error ¶
func (err NoSuchValueError) Error() string
type SqlBuilder ¶
type SqlBuilder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *SqlBuilder
func (*SqlBuilder) AppendParam ¶
func (builder *SqlBuilder) AppendParam(value interface{})
func (*SqlBuilder) AppendSql ¶
func (builder *SqlBuilder) AppendSql(sql string)
func (*SqlBuilder) Params ¶
func (builder *SqlBuilder) Params() []interface{}
func (*SqlBuilder) Sql ¶
func (builder *SqlBuilder) Sql() string