filters

package
v0.0.0-...-cbea63e Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TTFormats = []string{"2006-01-02 15:04:05.0 MST", "2006-01-02 15:04:05.0", "2006-01-02"}

TTFormats is a list of time formats as a list of strings used for parsing times supplied as strings

Functions

func Capitalize

func Capitalize(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

Capitalize capitalizes the supplied string

func ConvertKilometersToMiles

func ConvertKilometersToMiles(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

ConvertKilometersToMiles converts the supplied value in Km as Miles

func CurrencySymbol

func CurrencySymbol(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

CurrencySymbol returns a filter that retruns a currency symbol for the supplied currency isocode.

func EscapeEntities

func EscapeEntities(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

EscapeEntities applies HTML escaping tot he supplied input string.

func FormatCurrencyAmount

func FormatCurrencyAmount(locale string) pongo2.FilterFunction

FormatCurrencyAmount returns a filter that formats currency amount for display WITHOUT a currency symbol

func FormatDecimalAmount

func FormatDecimalAmount(locale string) pongo2.FilterFunction

FormatDecimalAmount returns a filter that formats decimal amount for display WITHOUT a currency symbol

func FormatShortCurrencyAmount

func FormatShortCurrencyAmount(locale string) pongo2.FilterFunction

FormatShortCurrencyAmount returns a filter that formats currency amount for display WITHOUT a currency symbol in a bizarrely complex way

func InsertSymbol

func InsertSymbol(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

InsertSymbol sort of inserts a symbol

func LocalizedDateFormatter

func LocalizedDateFormatter(locale string, timezone string) pongo2.FilterFunction

LocalizedDateFormatter returns a formatter for the context locale and time-zone that attempts to parse the input using a list of formats until a successful parse is achieved.

func LocalizedFormatCurrency

func LocalizedFormatCurrency(currency string, locale string) pongo2.FilterFunction

LocalizedFormatCurrency returns a filter that formats currency for display WITH symbol

func LookupMap

func LookupMap(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

LookupMap returns a value extracted from the map supplied as the value for the key supplied as param.

func MaskAccountNumber

func MaskAccountNumber(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

MaskAccountNumber applies various maskings to a number (or string>) supplied as a string, e.g. to card number.

func ParseTimeFromString

func ParseTimeFromString(in string, loc ...*time.Location) time.Time

ParseTimeFromString parses a date from the supplied value using an optional supplied location

func Passthrough

func Passthrough(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

Passthrough does nothing to the supplied input - just passes it through

func SimpleDateFormatter

func SimpleDateFormatter(timezone string) pongo2.FilterFunction

SimpleDateFormatter given a time-zone deduces an appropriate location and returns a filter that prses a date from a supplied string or timestamp.

func Split

func Split(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

Split splits a string based on a separator token.

func UnmarshalJson

func UnmarshalJson(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

UnmarshalJson interprets the input value as a JSON map or array and returns a Go map or array.

Types

This section is empty.

Jump to

Keyboard shortcuts

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