drouter

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DRouter

type DRouter struct {
	Host        string
	Verbose     bool
	InitWrapper *InitWrapper
	RouterNode
}

func (*DRouter) InitRouter

func (d *DRouter) InitRouter(router *httprouter.Router) error

type EndHandler

type EndHandler func(userdata interface{}, rw http.ResponseWriter, r *http.Request, p RequestInfo)

type EndPoint

type EndPoint struct {
	Method  string
	Handler EndHandler
}

type InitWrapper

type InitWrapper func(rw http.ResponseWriter, r *http.Request, i RequestInfo) (userdata interface{}, ok bool)

type Middleware

type Middleware func(userdataIn interface{}, rw http.ResponseWriter, r *http.Request, p RequestInfo) (userdataOut interface{}, ok bool)

type RequestInfo

type RequestInfo struct {
	Params httprouter.Params
	Route  string
}

type RouterNode

type RouterNode struct {
	PathPart  string
	EndPoint  *EndPoint
	Wrapper   *Middleware
	NextNodes []RouterNode
}

func (*RouterNode) CreateRoutes

func (n *RouterNode) CreateRoutes(router *httprouter.Router, path string, wrapper *Middleware, verbose bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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