router

package
v3.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTimeout

func CheckTimeout(ctx context.Context) error

func LogRequest

func LogRequest(reqID string, r *http.Request)

func LogResponse

func LogResponse(reqID string, r *http.Request, status int, err *ierrors.Error, additional ...log.Fields)

Types

type RouteHandler

type RouteHandler func(string, http.ResponseWriter, *http.Request)

type Router

type Router struct {
	Routes        []*route
	HealthHandler RouteHandler
	// contains filtered or unexported fields
}

func New

func New(prefix string) *Router

func (*Router) Add

func (r *Router) Add(method, prefix string, handler RouteHandler, exact bool)

func (*Router) GET

func (r *Router) GET(prefix string, handler RouteHandler, exact bool)

func (*Router) HEAD

func (r *Router) HEAD(prefix string, handler RouteHandler, exact bool)

func (*Router) OPTIONS

func (r *Router) OPTIONS(prefix string, handler RouteHandler, exact bool)

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(rw http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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