db

package
v0.0.0-...-773e468 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	Conn                                                 *sqlx.DB
	All, Ero, Eros, IngestEro, InsertUser, CreateSession *sqlx.Stmt
	CreateMeta, RemoveMeta, UpdateMeta, DeleteMeta       *sqlx.Stmt
	User, Lookup                                         *sqlx.Stmt
}

Database holds the connection to the DB as well as prepared statements on that connection.

func Init

func Init(c config.Config) (*Database, error)

Init takes in a config.Config and returns a Database connection and nil, or nil and the error reported by prep functions otherwise.

func (*Database) Ingest

func (d *Database) Ingest(buf *bytes.Buffer) error

Ingest takes in a Buffer and inserts each line into the DB. Returns nil on success, the error otherwise.

func (*Database) NewUser

func (d *Database) NewUser(uuid, user, hash string) error

Jump to

Keyboard shortcuts

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