record

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCols     = errors.New("the number of values is not the same as the number of columns")
	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 expected table columns")
	ErrStatNil  = errors.New("stats pointer is nil or the stats.values field is missing")
)

Functions

This section is empty.

Types

type Record

type Record struct {
	ID    string   // MySQL auto increment Id.
	UUID  string   // Unique Id.
	File  string   // Absolute path to file.
	Name  string   // Filename.
	Files []string // A list of files contained in the archive.
	NFO   string   // NFO or textfile to display on the site.
}

Record of a file item.

func New

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

New returns a Record generated from the sql rawbyte values.

func (*Record) Iterate

func (r *Record) Iterate(s *scan.Stats) error

Iterate through each sql rawbyte value.

func (*Record) Nfo

func (r *Record) Nfo(s *scan.Stats) error

Nfo finds an appropriate textfile and saves it to the database.

func (*Record) Read

func (r *Record) Read(s *scan.Stats) error

Read and save the archive content to the database.

func (*Record) Save

func (r *Record) Save() (int64, error)

Save updates the record in the database.

Jump to

Keyboard shortcuts

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