sqlite3

package
v0.0.0-...-16fbdda Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ds string) (*sqlx.DB, error)

Types

type Job

type Job struct {
	ID       int64  `db:"id"`
	ReportID int64  `db:"report_id"`
	Label    string `db:"label"`
}

type Line

type Line struct {
	ID    int64  `db:"id"`
	JobID int64  `db:"job_id"`
	Error int    `db:"error"`
	Text  string `db:"text"`
}

type Report

type Report struct {
	ID        int64  `db:"id"`
	CreatedAt *Time  `db:"created_at"`
	Name      string `db:"name"`
	Input     string `db:"input"`
}

type Repository

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

func NewRepository

func NewRepository(conn *sqlx.DB) *Repository

func (*Repository) InsertJob

func (repo *Repository) InsertJob(job *storage.Job) error

func (*Repository) InsertLine

func (repo *Repository) InsertLine(line *storage.Line) error

func (*Repository) InsertReport

func (repo *Repository) InsertReport(report *storage.Report) error

func (*Repository) JobReaders

func (repo *Repository) JobReaders(j storage.Job) (io.Reader, io.Reader)

func (*Repository) JobsByReport

func (repo *Repository) JobsByReport(report storage.Report) ([]storage.Job, error)

func (*Repository) LastReport

func (repo *Repository) LastReport() (storage.Report, error)

func (*Repository) Report

func (repo *Repository) Report(name string) (storage.Report, error)

func (*Repository) Reports

func (repo *Repository) Reports() ([]storage.Report, error)

type RowIterator

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

func (*RowIterator) Next

func (rc *RowIterator) Next() ([]byte, error)

type Time

type Time struct {
	T time.Time
}

Time wraps time.Time and implements the Valuer and Scanner interface.

func (*Time) Scan

func (t *Time) Scan(v interface{}) error

func (*Time) Value

func (t *Time) Value() (driver.Value, error)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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