database

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2013 License: BSD-3-Clause, GPL-3.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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) (*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) DeleteTag

func (db Database) DeleteTag(tagId uint) error

Deletes a tag.

func (*Database) DuplicateFiles

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

Retrieves the sets of duplicate files within the database.

func (*Database) File

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

Retrieves a specific file.

func (*Database) FileByPath

func (db *Database) FileByPath(path string) (*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) 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() (FileTags, error)

Retrieves the complete set of file tags.

func (*Database) FileTagsByFileId

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

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

func (*Database) FileTagsByTagId

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

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

func (*Database) Files

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

The complete set of tracked files.

func (*Database) FilesByDirectory

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

Retrieves all files that are under the specified directory.

func (*Database) FilesByFingerprint

func (db *Database) FilesByFingerprint(fingerprint fingerprint.Fingerprint) (Files, error)

Retrieves the set of files with the specified fingerprint.

func (*Database) FilesWithTag

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

Retrieves the set of files with the specified tag.

func (*Database) FilesWithTags

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

Retrieves the set of files with the specified tags.

func (*Database) Implications added in v0.2.0

func (db *Database) Implications() (Implications, error)

Retrieves the complete set of tag implications.

func (*Database) ImplicationsForTags added in v0.2.0

func (db *Database) ImplicationsForTags(tagIds []uint) (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) (*File, error)

Adds a file to the database.

func (Database) InsertTag

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

Adds a tag.

func (Database) RenameTag

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

Renames a tag.

func (Database) Tag

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

Retrieves a specific tag.

func (Database) TagByName

func (db Database) TagByName(name string) (*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() (Tags, error)

The set of tags.

func (*Database) TagsByFileId

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

Retrieves the set of tags for the specified file.

func (Database) TagsByNames

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

Retrieves the set of named tags.

func (*Database) UpdateFile

func (db *Database) UpdateFile(fileId uint, path string, fingerprint fingerprint.Fingerprint, modTime time.Time, size int64, isDir bool) (*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 File

type File struct {
	Id          uint
	Directory   string
	Name        string
	Fingerprint fingerprint.Fingerprint
	ModTime     time.Time
	Size        int64
	IsDir       bool
}

A tracked file.

func (File) Path

func (file File) Path() string

Retrieves the file's path.

type FileTag

type FileTag struct {
	FileId uint
	TagId  uint
}

type FileTags

type FileTags []*FileTag

type Files

type Files []*File

func (Files) Where

func (files Files) Where(predicate func(*File) bool) Files

type Implication added in v0.2.0

type Implication struct {
	ImplyingTag Tag
	ImpliedTag  Tag
}

type Implications added in v0.2.0

type Implications []*Implication

type Tag

type Tag struct {
	Id   uint
	Name string
}

type Tags

type Tags []*Tag

func (Tags) Any

func (tags Tags) Any(predicate func(*Tag) bool) bool

func (Tags) Len

func (tags Tags) Len() int

func (Tags) Less

func (tags Tags) Less(i, j int) bool

func (Tags) Swap

func (tags Tags) Swap(i, j int)

Jump to

Keyboard shortcuts

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