allRoutes

package
v1.84.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderOnsPageType = "ONS-Page-Type" // NOTE: when using the http method Add and Get, this returns the canonical format: "Ons-Page-Type"

HeaderOnsPageType is the header name that defines the handler that will be used by the Middleware

Variables

This section is empty.

Functions

func Handler

func Handler(routesHandler map[string]http.Handler, zebedeeClient ZebedeeClient, contentTypeByteLimit int) func(h http.Handler) http.Handler

Handler implements the middleware for dp-frontend-router. It sets the locale code, obtains the necessary cookies for the request path and access_token, authenticates with Zebedee if required, and obtains the "ONS-Page-Type" header to use the handler for the page type, if present.

Types

type ZebedeeClient added in v1.30.0

type ZebedeeClient interface {
	GetWithHeaders(ctx context.Context, userAccessToken, path string) ([]byte, http.Header, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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