handler

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultStaticHandler added in v1.0.6

type DefaultStaticHandler struct {
	StaticPath string

	StaticDir string
}

func (*DefaultStaticHandler) HandleStatic added in v1.0.6

func (staticHandler *DefaultStaticHandler) HandleStatic(writer http.ResponseWriter, request *http.Request)

func (*DefaultStaticHandler) Match added in v1.0.6

func (staticHandler *DefaultStaticHandler) Match(request *http.Request) bool

type PathTreeMap added in v1.0.6

type PathTreeMap struct {
	Root *PathTreeNode
}

func (*PathTreeMap) GetHandlerWrapper added in v1.0.6

func (pathTreeMap *PathTreeMap) GetHandlerWrapper(path string) *Wrapper

func (*PathTreeMap) PutHandlerWrapper added in v1.0.6

func (pathTreeMap *PathTreeMap) PutHandlerWrapper(path string, handlerWrapper *Wrapper)

type PathTreeNode added in v1.0.6

type PathTreeNode struct {
	SubPath        string
	Children       map[string]*PathTreeNode
	Parent         *PathTreeNode
	HandlerWrapper *Wrapper
}

type StaticHandler added in v1.0.6

type StaticHandler interface {
	Match(request *http.Request) bool
	HandleStatic(writer http.ResponseWriter, request *http.Request)
}

type Wrapper added in v1.0.6

type Wrapper struct {
	Path         string
	HasPathValue bool
	ReplacedPath string
	//PathValueRegex *regexp.Regexp
	Handler     interface{}
	FilterArray []filter.Filter
	HttpMethod  []string
	OutputType  reflect.Type
	Input       *wrapper.InputWrapper

	DefaultExceptionHandler exceptionhandler.ExceptionHandler
	RequestConverterMap     map[string]requestconverter.RequestConverter
	ResponseWriter          response.Writer
}

func CreateHandlerWrapper added in v1.0.6

func CreateHandlerWrapper(path string, httpMethod []string, handlerMethod interface{}) *Wrapper

func (*Wrapper) Handle added in v1.0.6

func (wrapper *Wrapper) Handle(writer http.ResponseWriter, request *http.Request) error

type WrapperMapping added in v1.0.6

type WrapperMapping struct {
	WrapperMapping map[string]*Wrapper

	PathValueWrapperMapping *PathTreeMap
}

func (*WrapperMapping) GetHandlerWrapper added in v1.0.6

func (wrapperMapping *WrapperMapping) GetHandlerWrapper(path string) *Wrapper

func (*WrapperMapping) RegisterHandlerWrapper added in v1.0.6

func (wrapperMapping *WrapperMapping) RegisterHandlerWrapper(wrapper *Wrapper)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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