gin

package
v0.0.0-...-fb45318 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package gorillamux implements a router.

It differs from the legacy router: * it provides somewhat granular errors: "path not found", "method not allowed". * it handles matching routes with extensions (e.g. /books/{id}.json) * it handles path patterns with a different syntax (e.g. /params/{x}/{y}/{z:.*})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(doc *openapi3.T) (routers.Router, error)

NewRouter creates a gorilla/mux router. Assumes spec is .Validate()d Note that a variable for the port number MUST have a default value and only this value will match as the port (see issue #367).

Types

type Router

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

Router helps link http.Request.s and an OpenAPIv3 spec

func (*Router) FindRoute

func (r *Router) FindRoute(req *http.Request) (*routers.Route, map[string]string, error)

FindRoute extracts the route and parameters of an http.Request

Jump to

Keyboard shortcuts

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