router

package
v0.3.82 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Annotate

func Annotate(annotators ...ngamux.Annotator) *ngamux.Annotation

func Configure

func Configure(c *config.Web)

func Delete

func Delete(path string, handlerFunc http.HandlerFunc, middleware ...ngamux.MiddlewareFunc)

func Get

func Get(path string, handlerFunc http.HandlerFunc, middleware ...ngamux.MiddlewareFunc)

func Group

func Group(path string) *ngamux.HttpServeMux

func HandleFunc

func HandleFunc(method, path string, handlerFunc http.HandlerFunc, middleware ...ngamux.MiddlewareFunc)

func Patch

func Patch(path string, handlerFunc http.HandlerFunc, middleware ...ngamux.MiddlewareFunc)

func Post

func Post(path string, handlerFunc http.HandlerFunc, middleware ...ngamux.MiddlewareFunc)

func Put

func Put(path string, handlerFunc http.HandlerFunc, middleware ...ngamux.MiddlewareFunc)

func Resource

func Resource(path string, resource ResourceHandler, opts ...func(*ngamux.HttpServeMux))

func Router

func Router() *ngamux.HttpServeMux

func Server

func Server() *http.Server

func Use

func Use(middleware ...ngamux.MiddlewareFunc)

func WithResourceMiddleware

func WithResourceMiddleware(middlewares ...ngamux.MiddlewareFunc) func(*ngamux.HttpServeMux)

Types

type ResourceHandler

type ResourceHandler interface {
	Index(http.ResponseWriter, *http.Request)
	Show(http.ResponseWriter, *http.Request)
	Store(http.ResponseWriter, *http.Request)
	Update(http.ResponseWriter, *http.Request)
	Destroy(http.ResponseWriter, *http.Request)
}

Jump to

Keyboard shortcuts

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