web

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

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

func NewApplication

func NewApplication() *Application

func (*Application) Close

func (app *Application) Close() error

func (*Application) Listen

func (app *Application) Listen(addr string) error

func (*Application) Use

func (app *Application) Use(fn HandlerFunc)

type Context

type Context struct {
	Req  *http.Request
	Res  http.ResponseWriter
	Log  logrus.FieldLogger
	Util *ContextUtil
	// contains filtered or unexported fields
}

func NewContext

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

func (*Context) Next

func (ctx *Context) Next()

type ContextUtil added in v1.1.0

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

func NewContextUtil added in v1.1.0

func NewContextUtil(ctx *Context) *ContextUtil

func (*ContextUtil) ParseBodyJson added in v1.1.0

func (u *ContextUtil) ParseBodyJson(v interface{}) error

func (*ContextUtil) ParseBodyJsonIterator added in v1.1.0

func (u *ContextUtil) ParseBodyJsonIterator() (jsoniter.Any, error)

func (*ContextUtil) ResponseJson added in v1.1.0

func (u *ContextUtil) ResponseJson(v interface{}) error

type HandlerFunc

type HandlerFunc = func(ctx *Context)

Jump to

Keyboard shortcuts

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