bucket

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 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")
	ErrNilBucket    = errors.New("bucket cannot be an empty directory")
)

Functions

func Abs

func Abs(name string) (string, error)

Abs returns an absolute representation of the named bucket.

func Count

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

Count the number of records in the bucket.

func Rename

func Rename(name string, assumeYes bool) string

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

func Stat

func Stat(name string, assumeYes, test bool) string

func Stats

func Stats(name string, assumeYes bool) bool

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

func Total

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

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

Types

type Cleaner

type Cleaner struct {
	Name  string // Name of the bucket.
	Debug bool   // Debug spams technobabble to stdout.
	Quiet bool   // Quiet the feedback sent to stdout.
	Total int    // Total items handled.
	Items int    // Items is the sum of the bucket items.
	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(db *bolt.DB) (items, finds, errors int, err error)

Clean the stale items from database buckets.

type Parser

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

func (*Parser) Parse

func (p *Parser) Parse(db *bolt.DB) (items, errs int, name string, debug bool)

Jump to

Keyboard shortcuts

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