core

package
v1.8.1-0...-ed8303a Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FormatHeader name of the header used to extract the format
	FormatHeader = "X-Format"

	// CodeHeader name of the header used as source of the HTTP status code to return
	CodeHeader = "X-Code"

	// OriginalURI name of the header with the original URL from NGINX
	OriginalURI = "X-Original-URI"

	// Namespace name of the header that contains information about the Ingress namespace
	Namespace = "X-Namespace"

	// IngressName name of the header that contains the matched Ingress
	IngressName = "X-Ingress-Name"

	// ServiceName name of the header that contains the matched Service in the Ingress
	ServiceName = "X-Service-Name"

	// ServicePort name of the header that contains the matched Service port in the Ingress
	ServicePort = "X-Service-Port"

	// RequestID is a unique ID that identifies the request - same as for backend service
	RequestID = "X-Request-ID"

	// ForwardedFor identifies the user of this session
	ForwardedFor = "X-Forwarded-For"

	// Host identifies the hosts origin
	Host = "Host"
)

Variables

This section is empty.

Functions

func RespondWithErrorPage

func RespondWithErrorPage(
	ctx *fasthttp.RequestCtx,
	cfg *config.Config,
	p templatePicker,
	rdr renderer,
	pageCode string,
	httpCode int,
	opt options.ErrorPage,
)

func SetClientFormat

func SetClientFormat(ctx *fasthttp.RequestCtx, t ContentType)

Types

type ContentType

type ContentType = byte
const (
	UnknownContentType ContentType = iota // should be first
	JSONContentType
	XMLContentType
	HTMLContentType
	PlainTextContentType
)

func ClientWantFormat

func ClientWantFormat(ctx *fasthttp.RequestCtx) ContentType

Jump to

Keyboard shortcuts

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