routing

package
v0.0.0-...-ec590a0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ControllersRegistry []Controller

Functions

This section is empty.

Types

type Controller

type Controller interface {
}

type Handle

type Handle func(*http.Request) http.Response

type Route

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

func (*Route) AddHandler

func (r *Route) AddHandler(handler Handle)

Adds a handler function for this route

func (*Route) Handle

func (r *Route) Handle(responseWriter ghttp.ResponseWriter, grequest *ghttp.Request, params httprouter.Params)

type Router

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

func NewRouter

func NewRouter() *Router

func (*Router) DELETE

func (r *Router) DELETE(path string, handler interface{})

Register DELETE route

func (*Router) GET

func (r *Router) GET(path string, handler interface{})

Register GET route

func (*Router) OPTIONS

func (r *Router) OPTIONS(path string, handler interface{})

Register OPTIONS route

func (*Router) PATCH

func (r *Router) PATCH(path string, handler interface{})

Register PATCH route

func (*Router) POST

func (r *Router) POST(path string, handler interface{})

Register POST route

func (*Router) PUT

func (r *Router) PUT(path string, handler interface{})

Register PUT route

func (*Router) Serve

func (r *Router) Serve(addr string) error

Jump to

Keyboard shortcuts

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