mux

package
v0.0.0-...-4fd5ebc Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2014 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 Config

type Config struct {
	DB        *sql.DB
	Templates *template.Template
	PublicDir string
}

type Context

type Context struct {
	Writer  http.ResponseWriter
	Request *http.Request
	Params  httprouter.Params
}

type Err

type Err struct {
	Status int
	Err    error
}

func (*Err) Error

func (e *Err) Error() string

type Handler

type Handler func(*Config, *Context) (*Response, error)

type Mux

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

func NewMux

func NewMux(config *Config) *Mux

func (*Mux) GET

func (m *Mux) GET(path string, handler Handler)

func (*Mux) POST

func (m *Mux) POST(path string, handler Handler)

func (*Mux) ServeHTTP

func (m *Mux) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Response

type Response struct {
	*httptest.ResponseRecorder
}

func NewResponse

func NewResponse() *Response

Jump to

Keyboard shortcuts

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