router

package
v0.0.0-...-051bd16 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: GPL-2.0 Imports: 2 Imported by: 0

README

Rainbows Router

The concept of the router in Rainbows is to allow multiple paths with the same arguments/path. In the event that one contains the wrong arguments, the next one is simply popped from the stack and ran.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Route

type Route func(req *fasthttp.RequestCtx, args [][]byte) (ok bool, err error)

Route is used to define the result of a HTTP route. ok means it was able to parse the route properly and error is route/parser errors.

type Router

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

Router defines the router binary tree.

func (*Router) Execute

func (r *Router) Execute(req *fasthttp.RequestCtx) (notFound bool, err error)

Execute tries to run a route using the tree.

func (*Router) LoadRoute

func (r *Router) LoadRoute(routePath string, route Route)

LoadRoute loads the route into the tree.

Jump to

Keyboard shortcuts

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