queryhttp

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointRegistry

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

EndpointRegistry is an endpoint registry that can register routes and instrument them.

func NewEndpointRegistry

func NewEndpointRegistry(router *mux.Router) *EndpointRegistry

NewEndpointRegistry returns a new endpoint registry.

func (*EndpointRegistry) MiddlewareOpts added in v1.2.0

func (r *EndpointRegistry) MiddlewareOpts(route *mux.Route) middleware.OverrideOptions

MiddlewareOpts returns the OverrideOptions for the route, or nil if none exist.

func (*EndpointRegistry) PathEntry added in v1.2.0

func (r *EndpointRegistry) PathEntry(path, method string) (*mux.Route, bool)

PathEntry resolves a registered route that was registered by path and method, not by path prefix.

func (*EndpointRegistry) Register

func (r *EndpointRegistry) Register(opts RegisterOptions) error

Register registers an endpoint.

func (*EndpointRegistry) RegisterPaths

func (r *EndpointRegistry) RegisterPaths(
	paths []string,
	opts RegisterPathsOptions) error

RegisterPaths registers multiple paths for the same handler.

func (*EndpointRegistry) Walk

func (r *EndpointRegistry) Walk(walkFn mux.WalkFunc) error

Walk walks the router and all its sub-routers, calling walkFn for each route in the tree. The routes are walked in the order they were added. Sub-routers are explored depth-first.

type RegisterOptions

type RegisterOptions struct {
	Path               string
	PathPrefix         string
	Handler            http.Handler
	Methods            []string
	MiddlewareOverride middleware.OverrideOptions
}

RegisterOptions are options for registering a handler.

type RegisterPathsOptions

type RegisterPathsOptions struct {
	Handler http.Handler
	Methods []string
}

RegisterPathsOptions is options for registering multiple paths with the same handler.

Jump to

Keyboard shortcuts

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