package
0.0.0-20240727104708-c2d1215a6a24
Repository: https://github.com/google/go-safeweb.git
Documentation: pkg.go.dev

# Functions

CSPNonces constructs a Config to add CSP nonces to a template.
LoadFiles matches the behavior of safehtml.ParseFiles but runs a transformation on every loaded template.
LoadGlob matches the behavior of safehtml.ParseGlob but runs a transformation on every loaded template.
LoadGlobEmbed is like LoadGlob but works on an embedded filesystem.
LoadTrustedTemplate processes the given TrustedTemplate with the specified default configurations and adds it to the given template.
Transform rewrites the given template according to the given configs.
XSRFTokens constructs a Config to add the given string as a child node to forms.

# Constants

CSPNoncesDefaultFuncName is the default func name for the func that generates CSP nonces.
XSRFTokensDefaultFuncName is the default func name for the func that generates XSRF tokens.

# Variables

CSPNoncesDefault is the default config for CSP Nonces.
XSRFTokensDefault is the default config to add hidden inputs to forms to provide an anti-XSRF token.

# Structs

LoadConfig is a configuration to use with loaders when processing a template.
Rule is a directive to instruct Transform on how to rewrite the given template.

# Type aliases

TransformConfig is a slice of Rules that are somehow related to each other.