Documentation
¶
Overview ¶
Package database interacts with Dupers bbolt database and buckets.
Index ¶
- Constants
- Variables
- func Abs(bucket string) ([]byte, error)
- func AllBuckets(db *bolt.DB) (names []string, err error)
- func Backup() (name string, written int64, err error)
- func Clean(quiet, debug bool, buckets ...string) error
- func Compact(debug bool) error
- func CopyFile(name, dest string) (int64, error)
- func Count(b *bolt.Bucket, db *bolt.DB) (int, error)
- func DB() (string, error)
- func Info() (string, error)
- func IsEmpty() (bool, error)
- func OpenRead() (db *bolt.DB, err error)
- func OpenWrite() (db *bolt.DB, err error)
- func RM(name string) error
- type Bucket
- type Filepath
- type Lists
- type Matches
Constants ¶
View Source
const ( PrivateFile fs.FileMode = 0600 PrivateDir fs.FileMode = 0700 NotFound = "This is okay as one will be created when using the dupe or search commands." )
Variables ¶
View Source
var ( ErrBucketNotFound = bolt.ErrBucketNotFound ErrBucketAsFile = errors.New("bucket points to a file, not a directory") ErrDBClean = errors.New("database has nothing to clean") ErrDBCompact = errors.New("database compression has not reduced the size") ErrDBEmpty = errors.New("database is empty and contains no items") ErrDBNotFound = errors.New("database file does not exist") ErrDBZeroByte = errors.New("database is a zero byte file") )
Functions ¶
func AllBuckets ¶
AllBuckets lists all the stored bucket names in the database.
func Clean ¶
Clean the stale items from database buckets. Stale items are file pointers that no longer exist on the host file system.
Types ¶
type Bucket ¶
type Bucket string
Bucket is the absolute path to a directory that's used as the bucket name.
type Matches ¶
Matches are a collection of fetched filepaths and the bucket they were sourced from.
func Compare ¶
Compare finds exact matches of the string contained within the stored filenames and paths.
func CompareBase ¶
CompareBase finds exact matches of the string contained within the stored filenames.
func CompareBaseNoCase ¶
CompareBaseNoCase finds case insensitive matches of the string contained within the stored filenames.
Click to show internal directories.
Click to hide internal directories.