middleware

package
v0.0.0-...-f984256 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextKeyDatabase defines the db context key
	ContextKeyDatabase = request.ContextKey("db")
)

Functions

This section is empty.

Types

type DatabaseAccessor

type DatabaseAccessor struct {
	*mgo.Session
}

DatabaseAccessor represents a mongo database encapsulation

func InitDB

func InitDB(dsn string) (*DatabaseAccessor, error)

InitDB creates a new mongo db server

type Logger

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

func NewLogger

func NewLogger(debug bool) *Logger

func (*Logger) Handler

func (m *Logger) Handler(handler http.Handler) http.Handler

type MongoDB

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

func NewMongoDB

func NewMongoDB(accessor *DatabaseAccessor) *MongoDB

func (*MongoDB) Handler

func (m *MongoDB) Handler(handler http.Handler) http.Handler

type Recovery

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

func NewRecovery

func NewRecovery(recoverFunc func(w http.ResponseWriter, r *http.Request, err interface{})) *Recovery

func (*Recovery) Handler

func (re *Recovery) Handler(handler http.Handler) http.Handler

Jump to

Keyboard shortcuts

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