queryhttp

package
Version: v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

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.

Source Files

Jump to

Keyboard shortcuts

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