bucket

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

© Ben Garrett https://github.com/bengarrett/dupers

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBucketAsFile = errors.New("bucket points to a file, not a directory")
	ErrBucketExists = errors.New("bucket already exists in the database")
	ErrBucketNotDir = errors.New("bucket path is not a directory")
	ErrBucketPath   = errors.New("directory used by the bucket does not exist on your system")
	ErrBucketSkip   = errors.New("bucket directory does not exist")
	ErrDB           = errors.New("db database cannot be nil")
)

Functions

func Abs

func Abs(name string) (string, error)

Abs returns an absolute representation of the named bucket.

func Count

func Count(name string, db *bolt.DB) (items int, err error)

Count the number of records in the bucket.

func Rename

func Rename(name string) string

Rename prompts for confirmation for the use of the named bucket.

func Stat

func Stat(name string, test bool) string

func Stats

func Stats(name string) bool

Stats checks the validity of the named bucket and prompts for user confirmation on errors.

func Total

func Total(buckets []string, db *bolt.DB) (int, error)

Total returns the sum total of the items in the named buckets.

Types

type Cleaner

type Cleaner struct {
	DB    *bolt.DB // Bold database.
	Abs   string   // Absolute path of the bucket.
	Debug bool     // Debug spams technobabble to stdout.
	Quiet bool     // Quiet the feedback sent to stdout.
	Cnt   int      // Cnt is the sum of the items.
	Total int      // Total items handled.
	Finds int      // Finds is the sum of the cleaned items.
	Errs  int      // Errs is the sum of the items that could not be cleaned.
}

func (*Cleaner) Clean

func (c *Cleaner) Clean() (items int, finds int, errors int)

Clean the stale items from database buckets.

type Parser

type Parser struct {
	Name  string   // Name of the bucket to parse.
	DB    *bolt.DB // Bold database.
	Cnt   int      // Cnt is the sum of the items.
	Errs  int      // Errs is the sum of the items that could not be parse.
	Debug bool     // Debug spams technobabble to stdout.
}

func (*Parser) Parse

func (p *Parser) Parse() (int, int, string, bool)

Jump to

Keyboard shortcuts

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