gee

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 9 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 {
	Writer http.ResponseWriter
	Req    *http.Request

	Path   string
	Method string
	Params map[string]string

	StatusCode int
	// contains filtered or unexported fields
}

func (*Context) Data

func (c *Context) Data(code int, data []byte)

func (*Context) Fail

func (c *Context) Fail(code int, data string)

func (*Context) HTML

func (c *Context) HTML(code int, name string, data interface{})

func (*Context) JSon

func (c *Context) JSon(code int, obj interface{})

func (*Context) Next

func (c *Context) Next()

func (*Context) Param

func (c *Context) Param(key string) string

func (*Context) PostForm

func (c *Context) PostForm(key string) string

func (*Context) Query

func (c *Context) Query(key string) string

func (*Context) SetHeader

func (c *Context) SetHeader(key, value string)

func (*Context) Status

func (c *Context) Status(code int)

func (*Context) String

func (c *Context) String(code int, format string, values ...interface{})

type Engine

type Engine struct {
	*RouterGroup
	// contains filtered or unexported fields
}

func Default

func Default() *Engine

func New

func New() *Engine

func (*Engine) Get

func (e *Engine) Get(pattern string, handler HandlerFunc)

func (*Engine) LoadHTMLGlob

func (e *Engine) LoadHTMLGlob(pattern string)

func (*Engine) Post

func (e *Engine) Post(pattern string, handler HandlerFunc)

func (*Engine) Run

func (e *Engine) Run(addr string) error

func (*Engine) SerFuncMap

func (e *Engine) SerFuncMap(funcMap template.FuncMap)

func (*Engine) ServeHTTP

func (e *Engine) ServeHTTP(w http.ResponseWriter, r *http.Request)

type H

type H map[string]interface{}

type HandlerFunc

type HandlerFunc func(c *Context)

func Logger

func Logger() HandlerFunc

func Recovery

func Recovery() HandlerFunc

type RouterGroup

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

func (*RouterGroup) Get

func (group *RouterGroup) Get(pattern string, handler HandlerFunc)

func (*RouterGroup) Group

func (group *RouterGroup) Group(prefix string) *RouterGroup

func (*RouterGroup) Post

func (group *RouterGroup) Post(pattern string, handler HandlerFunc)

func (*RouterGroup) Static

func (group *RouterGroup) Static(relativePath string, root string)

func (*RouterGroup) Use

func (group *RouterGroup) Use(middlewares ...HandlerFunc)

Jump to

Keyboard shortcuts

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