record

package
v1.11.13 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package record saves to the database the data collected from the file archive.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrID       = errors.New("record does not contain a valid value for the id column")
	ErrUUID     = errors.New("record does not contain a valid value for the uuid column")
	ErrRawBytes = errors.New("sql rawbytes is missing an expected table columns")
	ErrStatNil  = errors.New("scan stats pointer is nil or the stats.values field is missing")
	ErrValues   = errors.New("the number of values is not the same as the number of columns")
)

Functions

This section is empty.

Types

type Record

type Record struct {
	ID    string   // ID is the database auto increment ID.
	UUID  string   // Universal unique Id.
	File  string   // File is the absolute path to file archive.
	Name  string   // Name of the file archive.
	Files []string // Files contained in the archive.
	NFO   string   // NFO or textfile to display on the site.
}

Record object.

func New

func New(values []sql.RawBytes, path string) (Record, error)

New returns a Record generated from the sql rawbyte values.

func (*Record) Archive added in v1.11.0

func (r *Record) Archive(db *sql.DB, w io.Writer, s *scan.Stats) error

Archive reads and saves the archive content to the database.

func (*Record) Iterate

func (r *Record) Iterate(db *sql.DB, w io.Writer, s *scan.Stats) error

Iterate through each sql rawbyte value.

func (*Record) Save

func (r *Record) Save(db *sql.DB) (int64, error)

Save updates the record in the database.

func (*Record) Textfile added in v1.11.0

func (r *Record) Textfile(w io.Writer, s *scan.Stats) error

Textfile finds an appropriate text or NFO file and saves it to the database.

Jump to

Keyboard shortcuts

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