sqlite

package
v0.0.0-...-4958bb2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadRecord

type DownloadRecord struct {
	ID        int64          `json:"id"`
	URL       string         `json:"url"`
	Subfolder string         `json:"subfolder"`
	Output    sql.NullString `json:"output"`
	Errors    sql.NullString `json:"errors"`
	Finished  string         `json:"finished"`
	Filename  sql.NullString `json:"filename"`
	Title     sql.NullString `json:"title"`
}

DownloadRecord defines the stored download metadata

type Storage

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

Storage is the interface that defines interacting with Download Records

func NewStorage

func NewStorage(logger *log.Logger, sqlDir string) (*Storage, error)

NewStorage returns a new Sql DB storage

func (*Storage) AddDownloadRecord

func (s *Storage) AddDownloadRecord(dr *adding.DownloadRecord) (int64, error)

AddDownloadRecord Puts the records

func (*Storage) AllDownloadRecords

func (s *Storage) AllDownloadRecords() (*[]listing.DownloadRecord, error)

AllDownloadRecords gets records.

func (*Storage) GetDownloadRecord

func (s *Storage) GetDownloadRecord(id int64) (*listing.DownloadRecord, error)

GetDownloadRecord gets records.

func (*Storage) UpdateDownloadRecord

func (s *Storage) UpdateDownloadRecord(dr *updating.DownloadRecord) error

UpdateDownloadRecord Puts the records

Jump to

Keyboard shortcuts

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