Documentation
¶
Overview ¶
© Ben Garrett https://github.com/bengarrett/dupers
Index ¶
- func Contains(find string, s ...string) bool
- func Executable(root string) bool
- func Marker(file database.Filepath, term string, exact bool) string
- func Print(quiet, exact bool, term string, m *database.Matches) string
- type Bucket
- type Checksum
- type Checksums
- type Parser
- func (p *Parser) All() []Bucket
- func (p *Parser) Compares() int
- func (p *Parser) OpenRead()
- func (p *Parser) OpenWrite()
- func (p *Parser) PrintBuckets() string
- func (p *Parser) SetBucket(names ...string)
- func (p *Parser) SetBuckets() error
- func (p *Parser) SetCompares(name Bucket) (int, error)
- func (p *Parser) SetTimer()
- func (p *Parser) SetToCheck(name string)
- func (p *Parser) Timer() time.Duration
- func (p *Parser) ToCheck() string
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Executable ¶
Executable returns true if the root directory contains an MS-DOS or Windows program file.
func Print ¶
Print the results of the database comparisons.
Example ¶
package main
import (
"fmt"
"github.com/bengarrett/dupers/database"
"github.com/bengarrett/dupers/dupe/internal/parse"
"github.com/gookit/color"
)
const (
bucket1 = "../test/bucket1"
file1 = "../../../test/bucket1/0vlLaUEvzAWP"
)
func main() {
color.Enable = false
matches := database.Matches{}
matches[database.Filepath(file1)] = database.Bucket(bucket1)
s := parse.Print(true, true, "", &matches)
fmt.Print(s)
}
Output: ../../../test/bucket1/0vlLaUEvzAWP
Types ¶
type Parser ¶
type Parser struct {
DB *bolt.DB // Bolt database.
Buckets []Bucket // Buckets to lookup.
Compare Checksums // Compare hashes fetched from the database or file system.
Files int // Files count.
Sources []string // Sources are directories or files to compare.
Source string // Source directory or file to compare.
// contains filtered or unexported fields
}
func (*Parser) OpenWrite ¶
func (p *Parser) OpenWrite()
OpenWrite opens the Bolt database for reading and writing.
func (*Parser) PrintBuckets ¶
PrintBuckets returns a list of buckets used by the database.
func (*Parser) SetBuckets ¶
SetBuckets sets all the database buckets for use with the dupe or search commands.
func (*Parser) SetCompares ¶
SetCompares fetches items from the named bucket and sets them to c.compare.
func (*Parser) SetToCheck ¶
SetToCheck sets the named string as the directory or file to check.
Click to show internal directories.
Click to hide internal directories.