engine

package
v0.0.0-...-77d0bba Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Params   Params
	Request  *http.Request
	Response http.ResponseWriter
}

func (*Context) JSON

func (ctx *Context) JSON(status int, data interface{}) error

func (*Context) Text

func (ctx *Context) Text(status int, text string) error

type Handler

type Handler interface {
	Serve(ctx *Context) error
}

type HandlerFunc

type HandlerFunc func(ctx *Context) error

func (HandlerFunc) Serve

func (h HandlerFunc) Serve(ctx *Context) error

type M

type M map[string]interface{}

type Param

type Param struct {
	Key   string
	Value string
}

type Params

type Params []Param

func (Params) ByName

func (ps Params) ByName(name string) string

type Server

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

func NewRouter

func NewRouter() *Server

func (*Server) Get

func (s *Server) Get(route string, handler HandlerFunc)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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