tpl

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("closed")

Functions

This section is empty.

Types

type Hash

type Hash [hashLength]byte

func HashBytes

func HashBytes(b []byte) Hash

func HashStruct

func HashStruct(s interface{}) (Hash, error)

type Properties

type Properties struct {
	Code               string `token:"code"`
	Message            string `token:"message"`
	Description        string `token:"description"`
	OriginalURI        string `token:"original_uri"`
	Namespace          string `token:"namespace"`
	IngressName        string `token:"ingress_name"`
	ServiceName        string `token:"service_name"`
	ServicePort        string `token:"service_port"`
	RequestID          string `token:"request_id"`
	ForwardedFor       string `token:"forwarded_for"`
	Host               string `token:"host"`
	L10nDisabled       bool
	ShowRequestDetails bool
}

func (*Properties) Hash

func (p *Properties) Hash() (Hash, error)

func (*Properties) Replaces

func (p *Properties) Replaces() map[string]string

Replaces return a map with strings for the replacing, where the map key is a token.

type TemplateRenderer

type TemplateRenderer struct {
	// contains filtered or unexported fields
}

func NewTemplateRenderer

func NewTemplateRenderer() *TemplateRenderer

NewTemplateRenderer returns new template renderer. Don't forget to call Close() function!

func (*TemplateRenderer) Close

func (tr *TemplateRenderer) Close() error

func (*TemplateRenderer) Render

func (tr *TemplateRenderer) Render(content []byte, props Properties) ([]byte, error)

Jump to

Keyboard shortcuts

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