db

package
v0.0.0-...-856b1dc Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbEntry

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

File entry in the database

func NewDbEntry

func NewDbEntry(f string, m int64, l int64, h string) *DbEntry

type FileDb

type FileDb struct {
	*sql.DB
	// contains filtered or unexported fields
}

SQL Database containing the files and hashes

func CreateDb

func CreateDb(fname string) (*FileDb, error)

func OpenDb

func OpenDb(fname string) (*FileDb, error)

func (*FileDb) AddEntry

func (db *FileDb) AddEntry(entry *DbEntry) error

func (*FileDb) GetEntry

func (db *FileDb) GetEntry(filepath string) (*DbEntry, error)

func (*FileDb) NewEntry

func (db *FileDb) NewEntry(filepath string, mtime time.Time, lastactive time.Time, hash string) error

Create a new database entry from components

func (*FileDb) RemoveEntry

func (db *FileDb) RemoveEntry(filepath string) error

func (*FileDb) UpdateEntry

func (db *FileDb) UpdateEntry(filepath string, mtime time.Time, lastactive time.Time, hash string) error

Jump to

Keyboard shortcuts

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