gee

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: GPL-3.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 {
	// origin objects
	Writer http.ResponseWriter
	Req    *http.Request
	// request info
	Path   string
	Method string
	Params map[string]string
	// response info
	StatusCode int
	// contains filtered or unexported fields
}

func (*Context) Data

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

func (*Context) Fail added in v0.0.9

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

func (*Context) HTML

func (c *Context) HTML(code int, html string)

func (*Context) JSON

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

func (*Context) Next added in v0.0.9

func (c *Context) Next()

func (*Context) Query

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

func (*Context) SetHeader

func (c *Context) SetHeader(key string, 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 {
	*GroupRoute
	// contains filtered or unexported fields
}

func Defaule added in v0.0.9

func Defaule() *Engine

func New

func New() *Engine

func (*Engine) GET added in v0.0.9

func (engine *Engine) GET(pattern string, handler HandlerFunc)

func (*Engine) Getroute added in v0.0.9

func (engine *Engine) Getroute(path string)

func (*Engine) POST

func (engine *Engine) POST(pattern string, handler HandlerFunc)

func (*Engine) Run

func (engine *Engine) Run(address string)

func (*Engine) ServeHTTP

func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GroupRoute added in v0.0.9

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

func (*GroupRoute) GET added in v0.0.9

func (group *GroupRoute) GET(pattern string, handler HandlerFunc)

GET defines the method to add GET request

func (*GroupRoute) Group added in v0.0.9

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

func (*GroupRoute) POST added in v0.0.9

func (group *GroupRoute) POST(pattern string, handler HandlerFunc)

POST defines the method to add POST request

func (*GroupRoute) Static added in v0.0.9

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

serve static files

func (*GroupRoute) USE added in v0.0.9

func (group *GroupRoute) USE(middlewares ...HandlerFunc)

type H

type H map[string]interface{}

type HandlerFunc

type HandlerFunc func(*Context)

func Logger added in v0.0.9

func Logger() HandlerFunc

func Recovery added in v0.0.9

func Recovery() HandlerFunc

Directories

Path Synopsis
gee module

Jump to

Keyboard shortcuts

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