handler

package
v0.0.0-...-7690095 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2017 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotFoundHandler            = http.HandlerFunc(NotFound)
	InternalServerErrorHandler = http.HandlerFunc(InternalServerError)
	ForbiddenHandler           = http.HandlerFunc(Forbidden)
)

Functions

func ErrorHTML

func ErrorHTML(w http.ResponseWriter, r *http.Request, status int)

func Forbidden

func Forbidden(w http.ResponseWriter, r *http.Request)

func InternalServerError

func InternalServerError(w http.ResponseWriter, r *http.Request)

func NewControllerHandler

func NewControllerHandler() http.Handler

func NewForbiddenHandler

func NewForbiddenHandler() http.Handler

func NewInternalServerErrorHandler

func NewInternalServerErrorHandler() http.Handler

func NewNotFoundHandler

func NewNotFoundHandler() http.Handler

func NotFound

func NotFound(w http.ResponseWriter, r *http.Request)

Types

type ControllerHandler

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

func NewDefaultControllerHandler

func NewDefaultControllerHandler(controlmeta *controller.Meta, action string) *ControllerHandler

func NewNamedControllerHandler

func NewNamedControllerHandler(mod, ctrler, action string) (chand *ControllerHandler)

func (*ControllerHandler) GetControlManager

func (ch *ControllerHandler) GetControlManager(context *web.Context) (cm *controller.ControlManager)

func (*ControllerHandler) ServeContextHTTP

func (ch *ControllerHandler) ServeContextHTTP(ctxt *web.Context)

func (*ControllerHandler) ServeContextOptions

func (ch *ControllerHandler) ServeContextOptions(ctxt *web.Context, origin map[string]string)

func (*ControllerHandler) ServeHTTP

func (ch *ControllerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*ControllerHandler) ServeOptions

func (ch *ControllerHandler) ServeOptions(w http.ResponseWriter, r *http.Request, origin map[string]string)

func (*ControllerHandler) SetAction

func (ch *ControllerHandler) SetAction(action string)

func (*ControllerHandler) SetController

func (ch *ControllerHandler) SetController(mod, ctrler string)

func (*ControllerHandler) SetControllerMeta

func (ch *ControllerHandler) SetControllerMeta(controlmeta *controller.Meta)

type DynamicHandler

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

func NewDefaultDynamicHandler

func NewDefaultDynamicHandler(ctrlgroup *controller.Group, action, control, mod string) *DynamicHandler

func NewDynamicHandler

func NewDynamicHandler(ctrlgroup *controller.Group) *DynamicHandler

func (*DynamicHandler) Action

func (dh *DynamicHandler) Action() string

func (*DynamicHandler) Controller

func (dh *DynamicHandler) Controller() string

func (*DynamicHandler) GetControlManager

func (dh *DynamicHandler) GetControlManager(context *web.Context) (cm *controller.ControlManager)

func (*DynamicHandler) Module

func (dh *DynamicHandler) Module() string

func (*DynamicHandler) ServeContextHTTP

func (dh *DynamicHandler) ServeContextHTTP(context *web.Context)

func (*DynamicHandler) ServeContextOptions

func (dh *DynamicHandler) ServeContextOptions(context *web.Context, origin map[string]string)

func (*DynamicHandler) ServeHTTP

func (dh *DynamicHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*DynamicHandler) ServeOptions

func (dh *DynamicHandler) ServeOptions(w http.ResponseWriter, r *http.Request, origin map[string]string)

func (*DynamicHandler) SetAction

func (dh *DynamicHandler) SetAction(action string)

func (*DynamicHandler) SetController

func (dh *DynamicHandler) SetController(control string)

func (*DynamicHandler) SetModule

func (dh *DynamicHandler) SetModule(mod string)

type StaticFileHandler

type StaticFileHandler struct {
	BasePath    string // relative path from application or absolute path
	BaseURL     string // relative path of domain
	DefaultType string
	Cache       int
	Gzip        []string
	GzippedFile bool
	GzipMinSize int64
}

func NewStaticFileHandler

func NewStaticFileHandler() *StaticFileHandler

func NewStaticFileHandlerPath

func NewStaticFileHandlerPath(basepath string, baseurl string) *StaticFileHandler

func (*StaticFileHandler) ServeHTTP

func (sh *StaticFileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*StaticFileHandler) ServeOptions

func (sh *StaticFileHandler) ServeOptions(w http.ResponseWriter, _ *http.Request, _ map[string]string)

type WSArgs

type WSArgs []string

type WebSocketHandler

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

func NewWebSocketHandler

func NewWebSocketHandler(ctrler interface{}, allowcmd bool) *WebSocketHandler

func (*WebSocketHandler) ServeContextHTTP

func (wh *WebSocketHandler) ServeContextHTTP(context *web.Context)

func (*WebSocketHandler) ServeHTTP

func (wh *WebSocketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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