infrastructure

package
v0.0.0-...-df8d4a8 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(routes []interfaces.Route) *mux.Router

NewRouter creates a new mux router

func WebLogger

func WebLogger(inner http.Handler, name string) http.Handler

WebLogger http handler decorator which logs method, uri, name, duration

Types

type SqliteHandler

type SqliteHandler struct {
	Conn *sql.DB
}

SqliteHandler exposes the sqlite3 connection

func NewSqliteHandler

func NewSqliteHandler(dbFileName string) *SqliteHandler

NewSqliteHandler creates a new SqliteHandler

func (*SqliteHandler) Execute

func (handler *SqliteHandler) Execute(statement string) (r sql.Result, e error)

Execute performs the sql statement in a transaction

func (*SqliteHandler) Query

func (handler *SqliteHandler) Query(statement string) interfaces.Row

Query performs the given statement on the DB

type SqliteRow

type SqliteRow struct {
	Rows *sql.Rows
}

SqliteRow is Sqlite implementation fo the Row interface

func (*SqliteRow) Close

func (r *SqliteRow) Close()

func (*SqliteRow) Next

func (r *SqliteRow) Next() bool

Next iterates to the next row result. Returns true when row exists false otherwise

func (*SqliteRow) Scan

func (r *SqliteRow) Scan(dest ...interface{}) error

Scan reads values into given paramaters e.g. Scan(&id, &some_field1, &some_field2)

Jump to

Keyboard shortcuts

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