database

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2014 License: BSD-3-Clause, GPL-3.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Path string

Functions

This section is empty.

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

func Open

func Open() (*Database, error)

func OpenAt

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

func (*Database) AddFileTag

func (db *Database) AddFileTag(fileId, tagId uint) (*entities.FileTag, error)

Adds a file tag.

func (*Database) AddFileTags

func (db *Database) AddFileTags(fileId uint, tagIds []uint) error

Adds a set of file tags.

func (Database) AddImplication added in v0.2.0

func (db Database) AddImplication(tagId, impliedTagId uint) error

Adds the specified implications

func (*Database) Close

func (db *Database) Close() error

func (*Database) CopyFileTags

func (db *Database) CopyFileTags(sourceTagId uint, destTagId uint) error

Copies file tags from one tag to another.

func (Database) CreateSchema

func (db Database) CreateSchema() error

func (*Database) DeleteFile

func (db *Database) DeleteFile(fileId uint) error

Removes a file from the database.

func (*Database) DeleteFileTag

func (db *Database) DeleteFileTag(fileId, tagId uint) error

Removes an file tag.

func (*Database) DeleteFileTagsByFileId

func (db *Database) DeleteFileTagsByFileId(fileId uint) error

Removes all of the file tags for the specified file.

func (*Database) DeleteFileTagsByTagId

func (db *Database) DeleteFileTagsByTagId(tagId uint) error

Removes all of the file tags for the specified tag.

func (Database) DeleteImplication added in v0.2.0

func (db Database) DeleteImplication(tagId, impliedTagId uint) error

Deletes the specified implications

func (Database) DeleteImplicationsForTagId added in v0.2.0

func (db Database) DeleteImplicationsForTagId(tagId uint) error

Deletes implications featuring the specified tag.

func (*Database) DeleteQuery added in v0.3.0

func (db *Database) DeleteQuery(text string) error

Removes a query from the database.

func (Database) DeleteTag

func (db Database) DeleteTag(tagId uint) error

Deletes a tag.

func (*Database) DuplicateFiles

func (db *Database) DuplicateFiles() ([]entities.Files, error)

Retrieves the sets of duplicate files within the database.

func (*Database) File

func (db *Database) File(id uint) (*entities.File, error)

Retrieves a specific file.

func (*Database) FileByPath

func (db *Database) FileByPath(path string) (*entities.File, error)

Retrieves the file with the specified path.

func (*Database) FileCount

func (db *Database) FileCount() (uint, error)

Retrieves the total number of tracked files.

func (*Database) FileCountByFingerprint

func (db *Database) FileCountByFingerprint(fingerprint fingerprint.Fingerprint) (uint, error)

Retrieves the number of files with the specified fingerprint.

func (*Database) FileCountWithTag

func (db *Database) FileCountWithTag(tagId uint) (uint, error)

Retrieves the count of files with the specified tag.

func (*Database) FileCountWithTags

func (db *Database) FileCountWithTags(tagIds []uint) (uint, error)

Retrieves the count of files with the specified tags.

func (*Database) FileTagCount

func (db *Database) FileTagCount() (uint, error)

Retrieves the total count of file tags in the database.

func (*Database) FileTagCountByFileId

func (db *Database) FileTagCountByFileId(fileId uint) (uint, error)

Retrieves the count of file tags for the specified file.

func (*Database) FileTagCountByTagId added in v0.3.0

func (db *Database) FileTagCountByTagId(tagId uint) (uint, error)

Retrieves the count of file tags for the specified tag.

func (*Database) FileTagExists

func (db *Database) FileTagExists(fileId, tagId uint) (bool, error)

Determines whether the specified file has the specified tag applied.

func (*Database) FileTags

func (db *Database) FileTags() (entities.FileTags, error)

Retrieves the complete set of file tags.

func (*Database) FileTagsByFileId

func (db *Database) FileTagsByFileId(fileId uint) (entities.FileTags, error)

Retrieves the set of file tags with the specified file ID.

func (*Database) FileTagsByTagId

func (db *Database) FileTagsByTagId(tagId uint) (entities.FileTags, error)

Retrieves the set of file tags with the specified tag ID.

func (*Database) Files

func (db *Database) Files() (entities.Files, error)

The complete set of tracked files.

func (*Database) FilesByDirectory

func (db *Database) FilesByDirectory(path string) (entities.Files, error)

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

func (db *Database) FilesWithTag(tagId uint) (entities.Files, error)

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

func (db *Database) InsertQuery(text string) (*entities.Query, error)

Adds a query to the database.

func (Database) InsertTag

func (db Database) InsertTag(name string) (*entities.Tag, error)

Adds a tag.

func (*Database) Queries added in v0.3.0

func (db *Database) Queries() (entities.Queries, error)

The complete set of queries.

func (*Database) Query added in v0.3.0

func (db *Database) Query(text string) (*entities.Query, error)

Retrieves the specified query.

func (*Database) QueryFiles added in v0.3.0

func (db *Database) QueryFiles(expression query.Expression) (entities.Files, error)

Retrieves the set of files matching the specified query.

func (Database) RenameTag

func (db Database) RenameTag(tagId uint, name string) (*entities.Tag, error)

Renames a tag.

func (Database) Tag

func (db Database) Tag(id uint) (*entities.Tag, error)

Retrieves a specific tag.

func (Database) TagByName

func (db Database) TagByName(name string) (*entities.Tag, error)

Retrieves a specific tag.

func (*Database) TagCount

func (db *Database) TagCount() (uint, error)

The number of tags in the database.

func (Database) Tags

func (db Database) Tags() (entities.Tags, error)

The set of tags.

func (*Database) TagsByFileId

func (db *Database) TagsByFileId(fileId uint) (entities.Tags, error)

Retrieves the set of tags for the specified file.

func (Database) TagsByNames

func (db Database) TagsByNames(names []string) (entities.Tags, error)

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

func (db Database) UpdateImplicationsForTagId(implyingTagId, impliedTagId uint) error

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)

Jump to

Keyboard shortcuts

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