Go

package
v0.0.0-...-d1ed3aa Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPage

func GetPage(ldelim string, rdelim string, filename ...string) (*template.Template, error)
func (this* Context) GetPage(ldelim string,rdelim string,filename ...string) (*template.Template,error){
	tmp,err := template.New("").Delims(ldelim,rdelim).ParseFiles(filename...)
	return tmp,err
}

func HandleHTTP

func HandleHTTP(h Handler) http.HandlerFunc

Types

type Context

type Context struct {
	RespWriter http.ResponseWriter
	Request    *http.Request
	IO         *bufio.ReadWriter // reader from body and writer to conn
	Headers    http.Header
	Cookies    []*http.Cookie
	RemoteAddr string
}

func (*Context) Redirect

func (this *Context) Redirect(url string, code int)

func (*Context) SetCookie

func (this *Context) SetCookie(c http.Cookie)

func (*Context) WriteByteIO

func (this *Context) WriteByteIO(b byte) error

func (*Context) WriteIO

func (this *Context) WriteIO(b []byte) (int, error)

func (*Context) WriteRuneIO

func (this *Context) WriteRuneIO(r rune) (int, error)

func (*Context) WriteStringIO

func (this *Context) WriteStringIO(s string) (int, error)

func (*Context) WriteToIO

func (this *Context) WriteToIO(w io.Writer) (int64, error)

type Handler

type Handler func(*Context)

Jump to

Keyboard shortcuts

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