router

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(route string) (tokens []lex.Token)

Types

type Router

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

Router struct

func New

func New() *Router

New router

func (*Router) Add

func (rt *Router) Add(method, route string, handler http.Handler) error

Add a handler to a route

func (*Router) Delete

func (rt *Router) Delete(route string, handler http.Handler) error

Delete route

func (*Router) Get

func (rt *Router) Get(route string, handler http.Handler) error

Get route

func (*Router) Middleware

func (rt *Router) Middleware(next http.Handler) http.Handler

Middleware implements the router middleware

func (*Router) Patch

func (rt *Router) Patch(route string, handler http.Handler) error

Patch route

func (*Router) Post

func (rt *Router) Post(route string, handler http.Handler) error

Post route

func (*Router) Put

func (rt *Router) Put(route string, handler http.Handler) error

Put route

func (*Router) ServeHTTP

func (rt *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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