middleware

package
v0.0.0-...-6de6600 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2014 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ViewPath   = "view"
	LayoutFile = "layout/default.html"
)
View Source
var Config = &struct {
	App *struct {
		Bind    string `json:"bind"`
		WebRoot string `json:"webroot"`
		Env     string `json:"env"`
		NumDoc  int64  `json:"numdoc"`
	} `json:"app"`
	Upload *struct {
		Server string `json:"server"`
		Root   string `json:"root"`
	} `json:"upload"`
	Rethink *struct {
		Address   string `json:"address"`
		Database  string `json:"database"`
		MaxIdle   int    `json:"maxIdle"`
		MaxActive int    `json:"maxActive"`
	} `json:"rethink"`
	Redis map[string]*struct {
		Address string `json:"address"`
	} `json:"redis"`
}{}
View Source
var DefaultServerMux = &ServerMux{}

Functions

func BadRequest

func BadRequest(w http.ResponseWriter)

func Fatal

func Fatal(w http.ResponseWriter)

func LoadConfig

func LoadConfig(file string) error

func NotFound

func NotFound(w http.ResponseWriter)

func RenderJSON

func RenderJSON(w io.Writer, data interface{}) error

func RenderView

func RenderView(w io.Writer, filename string, data Data) error

func Route

func Route(pattern string, handler interface{})

func Run

func Run()

Types

type Data

type Data map[string]interface{}

type ServerMux

type ServerMux struct {
}

func (*ServerMux) ServeHTTP

func (s *ServerMux) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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