restsvr

package
v0.0.0-...-14a4516 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func By

func By(h Handler) func(res http.ResponseWriter, req *http.Request, par httprouter.Params)

Types

type Context

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

func (*Context) Header

func (ctx *Context) Header(name string) string

func (*Context) Param

func (ctx *Context) Param(name string) string

func (*Context) ParamInt

func (ctx *Context) ParamInt(name string) (int, error)

func (*Context) ParseForm

func (ctx *Context) ParseForm() map[string][]string

func (*Context) Read

func (ctx *Context) Read() ([]byte, error)

func (*Context) ReadJson

func (ctx *Context) ReadJson(v interface{}) error

func (*Context) ReadString

func (ctx *Context) ReadString() (string, error)

func (*Context) RedirectSeeOther

func (ctx *Context) RedirectSeeOther(url string)

func (*Context) StatusBadRequest

func (ctx *Context) StatusBadRequest(msg string)

func (*Context) StatusInternalServerError

func (ctx *Context) StatusInternalServerError(msg string)

func (*Context) StatusUnAuthorized

func (ctx *Context) StatusUnAuthorized(msg string)

func (*Context) Write

func (ctx *Context) Write(b []byte, contentType string) error

func (*Context) WriteJson

func (ctx *Context) WriteJson(v interface{}) error

func (*Context) WriteString

func (ctx *Context) WriteString(s string) error

type Handler

type Handler func(ctx *Context)

Jump to

Keyboard shortcuts

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