route

package
v0.0.0-...-785fa05 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Activate

func Activate(rmbs []RouteMiddlewareBundle) *hitch.Hitch

Activate hitches one or more RouteMiddlewareBundle structs together.

Types

type HttpMethodReceiver

type HttpMethodReceiver func(path string, handler http.Handler, middleware ...func(http.Handler) http.Handler)

type RouteDatum

type RouteDatum struct {
	Reciever    string // One of: "get", "post", "put", "patch", or "delete".  Or a combination of them separated by pipes, e.g.: "post|put"
	Path        string
	HandlerFunc func(w http.ResponseWriter, req *http.Request)
}

RouteDatum encompasses a single route entry.

type RouteMiddlewareBundle

type RouteMiddlewareBundle struct {
	Middlewares []func(http.Handler) http.Handler
	RouteData   []RouteDatum
}

RouteMiddlewareBundle is the struct which represents a group of middleware + route entries.

func (*RouteMiddlewareBundle) Activate

func (rmb *RouteMiddlewareBundle) Activate() *hitch.Hitch

Activate prepares a hitch for a single RouteMiddlewareBundle.

Jump to

Keyboard shortcuts

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