rest

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT 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 added in v1.2.5

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 added in v1.2.5

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

func (*Context) Fail added in v1.2.5

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

func (*Context) File added in v1.2.5

func (c *Context) File(filepath string)

func (*Context) HTML added in v1.2.5

func (c *Context) HTML(code int, name string, data any)

func (*Context) JSON added in v1.2.5

func (c *Context) JSON(code int, obj any)

func (*Context) Next added in v1.2.5

func (c *Context) Next()

func (*Context) Param added in v1.2.5

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

func (*Context) PostForm added in v1.2.5

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

func (*Context) Query added in v1.2.5

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

func (*Context) SetHeader added in v1.2.5

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

func (*Context) Status added in v1.2.5

func (c *Context) Status(code int)

func (*Context) String added in v1.2.5

func (c *Context) String(code int, format string, values ...any)

type Engine added in v1.2.5

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

func Default added in v1.2.5

func Default() *Engine

func New added in v1.2.5

func New() *Engine

func (*Engine) LoadHTMLGlob added in v1.2.5

func (engine *Engine) LoadHTMLGlob(pattern string)

func (*Engine) Run added in v1.2.5

func (engine *Engine) Run(addr string) (err error)

func (*Engine) ServeHTTP added in v1.2.5

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

func (*Engine) SetFuncMap added in v1.2.5

func (engine *Engine) SetFuncMap(funcMap template.FuncMap)

type H added in v1.2.5

type H map[string]any

type HandlerFunc added in v1.2.5

type HandlerFunc func(*Context)

func BasicAuth added in v1.2.5

func BasicAuth(h HandlerFunc, requiredUser, requiredPassword string) HandlerFunc

func CORS added in v1.2.5

func CORS() HandlerFunc

func Logger added in v1.2.5

func Logger() HandlerFunc

func Recovery added in v1.2.5

func Recovery() HandlerFunc

type RouterGroup added in v1.2.5

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

func (*RouterGroup) GET added in v1.2.5

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

func (*RouterGroup) Group added in v1.2.5

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

func (*RouterGroup) POST added in v1.2.5

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

func (*RouterGroup) Static added in v1.2.5

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

func (*RouterGroup) Use added in v1.2.5

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

Jump to

Keyboard shortcuts

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