middleware

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(next http.Handler) http.Handler

BasicAuth implements HTTP Basic Authentication middleware

Types

type CustomRouter

type CustomRouter struct {
	*httprouter.Router
	// contains filtered or unexported fields
}

CustomRouter extends httprouter.Router to handle API routes separately from data routes

func NewCustomRouter

func NewCustomRouter() *CustomRouter

NewCustomRouter creates a new CustomRouter

func (*CustomRouter) DELETE

func (r *CustomRouter) DELETE(path string, handle httprouter.Handle)

DELETE registers a DELETE handler for the API router if path starts with /__/, otherwise for the data router

func (*CustomRouter) GET

func (r *CustomRouter) GET(path string, handle httprouter.Handle)

GET registers a GET handler for the API router if path starts with /__/, otherwise for the data router

func (*CustomRouter) OPTIONS

func (r *CustomRouter) OPTIONS(path string, handle httprouter.Handle)

OPTIONS registers an OPTIONS handler for the API router if path starts with /__/, otherwise for the data router

func (*CustomRouter) PATCH

func (r *CustomRouter) PATCH(path string, handle httprouter.Handle)

PATCH registers a PATCH handler for the API router if path starts with /__/, otherwise for the data router

func (*CustomRouter) POST

func (r *CustomRouter) POST(path string, handle httprouter.Handle)

POST registers a POST handler for the API router if path starts with /__/, otherwise for the data router

func (*CustomRouter) PUT

func (r *CustomRouter) PUT(path string, handle httprouter.Handle)

PUT registers a PUT handler for the API router if path starts with /__/, otherwise for the data router

func (*CustomRouter) ServeHTTP

func (r *CustomRouter) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP implements the http.Handler interface

Jump to

Keyboard shortcuts

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