template

package
v1.8.1-0...-85b4cdc Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MiniHTML

func MiniHTML(data string) (string, error)

MiniHTML minifies HTML data, including inline CSS, SVG and JS.

func Render

func Render(content string, props Props) (string, error)

Types

type Props

type Props struct {
	Code               uint16 `token:"code"`          // http status code
	Message            string `token:"message"`       // status message
	Description        string `token:"description"`   // status description
	OriginalURI        string `token:"original_uri"`  // (ingress-nginx) URI that caused the error
	Namespace          string `token:"namespace"`     // (ingress-nginx) namespace where the backend Service is located
	IngressName        string `token:"ingress_name"`  // (ingress-nginx) name of the Ingress where the backend is defined
	ServiceName        string `token:"service_name"`  // (ingress-nginx) name of the Service backing the backend
	ServicePort        string `token:"service_port"`  // (ingress-nginx) port number of the Service backing the backend
	RequestID          string `token:"request_id"`    // (ingress-nginx) unique ID that identifies the request - same as for backend service
	ForwardedFor       string `token:"forwarded_for"` // the value of the `X-Forwarded-For` header
	Host               string `token:"host"`          // the value of the `Host` header
	ShowRequestDetails bool   `token:"show_details"`  // (config) show request details?
	L10nDisabled       bool   `token:"l10n_disabled"` // (config) disable localization feature?
}

func (Props) Values

func (p Props) Values() map[string]any

Values convert the Props struct into a map where each key is a token associated with its corresponding value.

Jump to

Keyboard shortcuts

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