mycaosf

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 9 Imported by: 0

README

https

http server

Only supply some utils now.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	W http.ResponseWriter
	R *http.Request
}

func NewContext

func NewContext(w http.ResponseWriter, r *http.Request) *Context

func (*Context) AddHeader

func (p *Context) AddHeader(name, value string)

add header to the response.

func (*Context) DelHeader

func (p *Context) DelHeader(name string)

del response header

func (*Context) Form

func (p *Context) Form() url.Values

func (*Context) FormValue

func (p *Context) FormValue(name string) string

func (*Context) NotFound

func (p *Context) NotFound()

func (*Context) PostForm

func (p *Context) PostForm() url.Values

func (*Context) ReadQuery

func (p *Context) ReadQuery(data interface{}) error

read value from URL or form

func (*Context) ServeFile

func (p *Context) ServeFile(name string)

func (*Context) SetHeader

func (p *Context) SetHeader(name, value string)

set header

func (*Context) Write

func (p *Context) Write(data []byte) (n int, err error)

func (*Context) WriteHeader

func (p *Context) WriteHeader(statusCode int, h http.Header)

h may be nil

func (*Context) WriteJSON

func (p *Context) WriteJSON(v interface{}) error

func (*Context) WriteString

func (p *Context) WriteString(str string) error

func (*Context) WriteXML

func (p *Context) WriteXML(v interface{}) error

Jump to

Keyboard shortcuts

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