ghttp

package
v0.0.0-...-b6b8bdf Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InjectParam  = "p"
	InjectForm   = "f"
	InjectHeader = "h"
	InjectCookie = "c"
)
View Source
const (
	HttpController = "HttpController"
)

Variables

View Source
var IHttpControllerType = reflect.TypeOf((*IHttpController)(nil)).Elem()

Functions

func AllControlPointPassFilter

func AllControlPointPassFilter(group, path string, point *controller.ControlPoint) *controller.ControlPoint

func NewRestViewRender

func NewRestViewRender() *restViewRender

func NewTextTemplateViewRender

func NewTextTemplateViewRender(name string, prefix string, suffix string) *textTemplateViewRender

func ParamInject

func ParamInject(val reflect.Value, ctx gnet.ISessionCtx)

Types

type ControlPointFilter

type ControlPointFilter func(group, path string, point *controller.ControlPoint) *controller.ControlPoint

type ExpireSession

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

func NewExpireSession

func NewExpireSession(ctx gnet.ISessionCtx, activeTime time.Time) *ExpireSession

type HttpBody

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

func NewHttpBody

func NewHttpBody(data []byte) *HttpBody

type HttpCookie

type HttpCookie struct {
	Cookies     []*http.Cookie
	ParamSingle map[string]string
}

func NewHttpCookie

func NewHttpCookie(cookies []*http.Cookie) *HttpCookie

type HttpForm

type HttpForm struct {
	Params      map[string][]string
	ParamSingle map[string]string
}

func NewHttpForm

func NewHttpForm(params map[string][]string) *HttpForm

type HttpHeader

type HttpHeader struct {
	Headers map[string][]string
}

func NewHttpHeader

func NewHttpHeader(headers map[string][]string) *HttpHeader

type HttpParam

type HttpParam struct {
	Params      map[string][]string
	ParamSingle map[string]string
}

func NewHttpParam

func NewHttpParam(params map[string][]string) *HttpParam

type HttpServer

type HttpServer struct {
	gioc.IBeanCondition
	gioc.IConfigBase
	// contains filtered or unexported fields
}

func NewHttpServer

func NewHttpServer(cfgBase string, filter ControlPointFilter) *HttpServer

func (*HttpServer) BeanStart

func (this *HttpServer) BeanStart()

func (*HttpServer) BeanStop

func (this *HttpServer) BeanStop()

type IHttpController

type IHttpController interface {
	controller.IController
	ViewRender() IViewRender
}

func NewHttpController

func NewHttpController(group string, viewRender IViewRender) IHttpController

func NewHttpRestController

func NewHttpRestController(group string) IHttpController

type IViewRender

type IViewRender interface {
	RendView(obj interface{}) ([]byte, error)
}

type ModAndView

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

func NewModAndView

func NewModAndView(view string, mod interface{}) *ModAndView

Jump to

Keyboard shortcuts

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