storage

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2014 License: BSD-3-Clause, GPL-3.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Db *database.Database
}

func Open

func Open() (*Storage, error)

func OpenAt

func OpenAt(path string) (*Storage, error)

func (*Storage) AddFile

func (storage *Storage) AddFile(path string, fingerprint fingerprint.Fingerprint, modTime time.Time, size int64, isDir bool) (*entities.File, error)

Adds a file to the database.

func (*Storage) AddFileTag

func (storage *Storage) AddFileTag(fileId, tagId, valueId uint) (*entities.FileTag, error)

Adds a file tag.

func (Storage) AddImplication added in v0.2.0

func (storage Storage) AddImplication(tagId, impliedTagId uint) error

Adds the specified implication.

func (*Storage) AddQuery added in v0.3.0

func (storage *Storage) AddQuery(text string) (*entities.Query, error)

Adds a query to the database.

func (*Storage) AddTag

func (storage *Storage) AddTag(name string) (*entities.Tag, error)

Adds a tag.

func (*Storage) AddValue added in v0.4.0

func (storage *Storage) AddValue(name string) (*entities.Value, error)

Adds a value.

func (*Storage) Begin added in v0.4.0

func (storage *Storage) Begin() error

func (*Storage) Close

func (storage *Storage) Close() error

func (*Storage) Commit added in v0.4.0

func (storage *Storage) Commit() error

func (*Storage) CopyFileTags

func (storage *Storage) CopyFileTags(sourceTagId, destTagId uint) error

Copies file tags from one tag to another.

func (Storage) CopyTag

func (storage Storage) CopyTag(sourceTagId uint, name string) (*entities.Tag, error)

Copies a tag.

func (*Storage) DeleteFile added in v0.4.0

func (storage *Storage) DeleteFile(fileId uint) error

Deletes a file from the database.

func (*Storage) DeleteFileIfUntagged added in v0.4.0

func (storage *Storage) DeleteFileIfUntagged(fileId uint) error

Deletes a file if it is untagged

func (*Storage) DeleteFileTag added in v0.4.0

func (storage *Storage) DeleteFileTag(fileId, tagId, valueId uint) error

Delete file tag.

func (*Storage) DeleteFileTagsByFileId added in v0.4.0

func (storage *Storage) DeleteFileTagsByFileId(fileId uint) error

Deletes all of the file tags for the specified file.

func (*Storage) DeleteFileTagsByTagId added in v0.4.0

func (storage *Storage) DeleteFileTagsByTagId(tagId uint) error

Deletes all of the file tags for the specified tag.

func (*Storage) DeleteQuery added in v0.3.0

func (storage *Storage) DeleteQuery(text string) error

Removes a query from the database.

func (Storage) DeleteTag

func (storage Storage) DeleteTag(tagId uint) error

Deletes a tag.

func (*Storage) DeleteUntaggedFiles added in v0.4.0

func (storage *Storage) DeleteUntaggedFiles() error

Deletes all untagged files from the database.

func (*Storage) DeleteUnusedValues added in v0.4.0

func (storage *Storage) DeleteUnusedValues() error

Deletes unused values.

func (*Storage) DeleteValue added in v0.4.0

func (storage *Storage) DeleteValue(valueId uint) error

Deletes a value.

func (*Storage) DeleteValueIfUnused added in v0.4.0

func (storage *Storage) DeleteValueIfUnused(valueId uint) error

Deletes the value if it is unused.

func (*Storage) DuplicateFiles

func (storage *Storage) DuplicateFiles() ([]entities.Files, error)

Retrieves the sets of duplicate files within the database.

func (*Storage) File

func (storage *Storage) File(id uint) (*entities.File, error)

Retrieves a specific file.

func (*Storage) FileByPath

func (storage *Storage) FileByPath(path string) (*entities.File, error)

Retrieves the file with the specified path.

func (*Storage) FileCount

func (storage *Storage) FileCount() (uint, error)

Retrieves the total number of tracked files.

func (*Storage) FileCountByFingerprint

func (storage *Storage) FileCountByFingerprint(fingerprint fingerprint.Fingerprint) (uint, error)

Retrieves the number of files with the specified fingerprint.

func (*Storage) FileCountWithTags

func (storage *Storage) FileCountWithTags(tagNames []string, path string, explicitOnly bool) (uint, error)

Retrieves the count of files with the specified tags and matching the specified path.

func (*Storage) FileTagCount

func (storage *Storage) FileTagCount() (uint, error)

Retrieves the total count of file tags in the database.

func (*Storage) FileTagCountByFileId

func (storage *Storage) FileTagCountByFileId(fileId uint, explicitOnly bool) (uint, error)

Retrieves the count of file tags for the specified file.

func (*Storage) FileTagCountByTagId added in v0.3.0

func (storage *Storage) FileTagCountByTagId(tagId uint) (uint, error)

Retrieves the count of file tags for the specified tag.

func (*Storage) FileTagCountByValueId added in v0.4.0

func (storage *Storage) FileTagCountByValueId(valueId uint) (uint, error)

Retrieves the count of file tags for the specified value.

func (*Storage) FileTagExists

func (storage *Storage) FileTagExists(fileId, tagId, valueId uint) (bool, error)

Determines whether the specified file has the specified tag applied.

func (*Storage) FileTags

func (storage *Storage) FileTags() (entities.FileTags, error)

Retrieves the complete set of file tags.

func (*Storage) FileTagsByFileId

func (storage *Storage) FileTagsByFileId(fileId uint, explicitOnly bool) (entities.FileTags, error)

Retrieves the file tags with the specified file ID.

func (*Storage) FileTagsByTagId

func (storage *Storage) FileTagsByTagId(tagId uint) (entities.FileTags, error)

Retrieves the file tags with the specified tag ID.

func (*Storage) FileTagsByValueId added in v0.4.0

func (storage *Storage) FileTagsByValueId(valueId uint) (entities.FileTags, error)

Retrieves the file tags with the specified value ID.

func (*Storage) Files

func (storage *Storage) Files() (entities.Files, error)

The complete set of tracked files.

func (*Storage) FilesByDirectories

func (storage *Storage) FilesByDirectories(paths []string) (entities.Files, error)

Retrieves all file that are under the specified directories.

func (*Storage) FilesByDirectory

func (storage *Storage) FilesByDirectory(path string) (entities.Files, error)

Retrieves all files that are under the specified directory.

func (*Storage) FilesByFingerprint

func (storage *Storage) FilesByFingerprint(fingerprint fingerprint.Fingerprint) (entities.Files, error)

Retrieves the set of files with the specified fingerprint.

func (*Storage) FilesWithTags

func (storage *Storage) FilesWithTags(tagNames []string, path string, explicitOnly bool) (entities.Files, error)

Retrieves the set of files with the specified tags and matching the specified path.

func (*Storage) Implications added in v0.2.0

func (storage *Storage) Implications() (entities.Implications, error)

Retrieves the complete set of tag implications.

func (*Storage) ImplicationsForTags added in v0.2.0

func (storage *Storage) ImplicationsForTags(tagIds ...uint) (entities.Implications, error)

Retrieves the set of implications for the specified tags.

func (*Storage) Queries added in v0.3.0

func (storage *Storage) Queries() (entities.Queries, error)

The complete set of queries.

func (*Storage) Query added in v0.3.0

func (storage *Storage) Query(text string) (*entities.Query, error)

Retrievs the specified query.

func (*Storage) QueryFileCount added in v0.4.0

func (storage *Storage) QueryFileCount(expression query.Expression, path string, explicitOnly bool) (uint, error)

Retrieves the count of files that match the specified query and matching the specified path.

func (*Storage) QueryFiles added in v0.3.0

func (storage *Storage) QueryFiles(expression query.Expression, path string, explicitOnly bool) (entities.Files, error)

Retrieves the set of files that match the specified query.

func (Storage) RemoveImplication added in v0.2.0

func (storage Storage) RemoveImplication(tagId, impliedTagId uint) error

Removes the specified implication

func (Storage) RemoveImplicationsForTagId added in v0.2.0

func (storage Storage) RemoveImplicationsForTagId(tagId uint) error

Removes implications featuring the specified tag.

func (Storage) RenameTag

func (storage Storage) RenameTag(tagId uint, name string) (*entities.Tag, error)

Renames a tag.

func (*Storage) Rollback added in v0.4.0

func (storage *Storage) Rollback() error

func (*Storage) Setting added in v0.4.0

func (storage *Storage) Setting(name string) (*entities.Setting, error)

Retrievs the specified setting.

func (*Storage) SettingAsBool added in v0.4.0

func (storage *Storage) SettingAsBool(name string) (bool, error)

Retrieves the specified setting's boolean value.

func (*Storage) SettingAsString added in v0.4.0

func (storage *Storage) SettingAsString(name string) (string, error)

Retrieves the specified setting's string value.

func (*Storage) Settings added in v0.4.0

func (storage *Storage) Settings() (entities.Settings, error)

The complete set of settings.

func (Storage) Tag

func (storage Storage) Tag(id uint) (*entities.Tag, error)

Retrieves a specific tag.

func (Storage) TagByName

func (storage Storage) TagByName(name string) (*entities.Tag, error)

Retrieves a specific tag.

func (*Storage) TagCount

func (storage *Storage) TagCount() (uint, error)

The number of tags in the database.

func (*Storage) Tags

func (storage *Storage) Tags() (entities.Tags, error)

The set of tags.

func (Storage) TagsByIds added in v0.4.0

func (storage Storage) TagsByIds(ids []uint) (entities.Tags, error)

Retrieves a specific set of tags.

func (Storage) TagsByNames

func (storage Storage) TagsByNames(names []string) (entities.Tags, error)

Retrieves the set of named tags.

func (Storage) TopTags added in v0.3.0

func (storage Storage) TopTags(count uint) ([]entities.TagFileCount, error)

Retrieves the most popular tags.

func (*Storage) UntaggedFiles added in v0.4.0

func (storage *Storage) UntaggedFiles() (entities.Files, error)

Retrieves the set of untagged files.

func (*Storage) UnusedValues added in v0.4.0

func (storage *Storage) UnusedValues() (entities.Values, error)

Retrievse the set of unused values.

func (*Storage) UpdateFile

func (storage *Storage) 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 (Storage) UpdateImplicationsForTagId added in v0.2.0

func (storage Storage) UpdateImplicationsForTagId(tagId, impliedTagId uint) error

Updates implications featuring the specified tag.

func (*Storage) Value added in v0.4.0

func (storage *Storage) Value(id uint) (*entities.Value, error)

Retrieves a specific value.

func (*Storage) ValueByName added in v0.4.0

func (storage *Storage) ValueByName(name string) (*entities.Value, error)

Retrieves a specific value by name.

func (*Storage) ValueCount added in v0.4.0

func (storage *Storage) ValueCount() (uint, error)

Retrievse the count of values.

func (*Storage) Values added in v0.4.0

func (storage *Storage) Values() (entities.Values, error)

Retrieves the complete set of values.

func (Storage) ValuesByIds added in v0.4.1

func (storage Storage) ValuesByIds(ids []uint) (entities.Values, error)

Retrieves a specific set of values.

func (*Storage) ValuesByNames added in v0.4.0

func (storage *Storage) ValuesByNames(names []string) (entities.Values, error)

Retrieves the set of values with the specified names.

func (*Storage) ValuesByTag added in v0.4.0

func (storage *Storage) ValuesByTag(tagId uint) (entities.Values, error)

Retrieves the set of values for the specified tag.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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