db

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SortByName sort duplicates by name
	SortByName = "name"
	// SortByModTime sort duplicates by modification time
	SortByModTime = "modtime"
)

Functions

This section is empty.

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

Database samedup main database

func NewDatabase

func NewDatabase(version string, newFileChan chan (*node.Node), resultChan chan (*Duplicates), hashMethod int, spinner *pterm.SpinnerPrinter, sortMode string, flogger *logger.FileLogger) *Database

NewDatabase create a new database

func (*Database) Save

func (d *Database) Save(path string) error

Save save database to file

func (*Database) Serialize

func (d *Database) Serialize() ([]byte, error)

Serialize serialize database data

func (*Database) Start

func (d *Database) Start()

Start start the database for indexing and processing nodes

type Duplicate

type Duplicate struct {
	Nodes  []*node.Node
	Key    string
	Wasted uint64
}

Duplicate list of nodes sharing the same key (checksum, name, size, etc)

type Duplicates

type Duplicates struct {
	Duplicates  []*Duplicate
	TotalWasted uint64
}

Duplicates found duplicates

Jump to

Keyboard shortcuts

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