routes

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Router router = router{Routes: map[string][]Route{}}

Functions

func Any added in v0.2.0

func Any(path string, handler fasthttp.RequestHandler)

use it if your handler works with any method

func Delete added in v0.2.0

func Delete(path string, handler fasthttp.RequestHandler)

func Get added in v0.2.0

func Get(path string, handler fasthttp.RequestHandler)

func Match added in v0.2.0

func Match(path string, handler fasthttp.RequestHandler, methods []string)

function for handler that works with multiple methods

func Options added in v0.2.0

func Options(path string, handler fasthttp.RequestHandler)

func Patch added in v0.2.0

func Patch(path string, handler fasthttp.RequestHandler)

func PermanentRedirect added in v0.2.0

func PermanentRedirect(path string, to string)

func Post added in v0.2.0

func Post(path string, handler fasthttp.RequestHandler)

func Put added in v0.2.0

func Put(path string, handler fasthttp.RequestHandler)

func Redirect added in v0.2.0

func Redirect(path string, to string)

redirect with default status 302

func Redirectc added in v0.2.0

func Redirectc(path string, to string, code int)

redirect with given code

func Redirectm added in v0.2.0

func Redirectm(path string, to string, method string, code int)

redirect by path and method with given code

Types

type Route

type Route struct {
	Method  string
	Handler fasthttp.RequestHandler
}

Jump to

Keyboard shortcuts

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