directors

package
v1.73.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Director

func Director(pathPrefix string) func(req *http.Request)

Director sets the appropriate headers and rewrites the request path to remove the prefix if provided.

The path rewrite will remove the prefix from the inbound request path.

For example, if the `pathPrefix` is `/api` then a request is made to:

"POST /api/v1/tokens"

will be proxied to:

"POST /v1/tokens"

func FixedVersionDirector deprecated

func FixedVersionDirector(apiRouterVersion string, pathPrefix string) func(req *http.Request)

FixedVersionDirector wraps the director(pathPrefix) function and prepends a fixed API version (e.g. `/v1`).

This function should not be used as it couples all calls from the JavaScript to the API to the same API version. It is best to instead include the API version in path used by the JavaScript client. Including the version in the client allows us to slowly update screens/clients to use new API versions rather than requiring a big bang approach.

Deprecated: use director(pathPrefix) function instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

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