sqlite3

package
v0.0.0-...-0b18c8e Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package sqlite3 allows storing http request data in sqlite databases.

Index

Constants

View Source
const (
	SQLITE_LOCKED = 6
)

https://www.sqlite.org/rescode.html

Variables

View Source
var DateFormats = map[string]string{
	"day":    "2006-01-02T-MST",
	"hour":   "2006-01-02T15-MST",
	"minute": "2006-01-02T15-04-MST",
}

Map shortcuts strings to verbose date formats.

Functions

func ExecRetry

func ExecRetry(db *sql.DB, codes map[int]bool, after time.Duration, query string, args ...interface{}) (sql.Result, error)

func QueryRetry

func QueryRetry(db *sql.DB, codes map[int]bool, after time.Duration, query string, args ...interface{}) (*sql.Rows, error)

Types

type SQLiteDumper

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

func NewDumper

func NewDumper(dateFmt, dbPath string) (*SQLiteDumper, error)

NewDumper returns an initialized SQLiteDumper that dumps request data to an SQLite db file.

func (*SQLiteDumper) BatchDone

func (sqld *SQLiteDumper) BatchDone(batchID int64) error

func (*SQLiteDumper) Dump

func (sqld *SQLiteDumper) Dump(req *storage.Request) error

func (*SQLiteDumper) MarkBatch

func (sqld *SQLiteDumper) MarkBatch() (int64, error)

func (*SQLiteDumper) ReadRequests

func (sqld *SQLiteDumper) ReadRequests(batchID int64) ([]storage.Request, error)

Jump to

Keyboard shortcuts

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