filters

package
v0.0.0-...-ff1a346 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: BSD-3-Clause, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyValue = &core.StaticStringValue{""}
)

Functions

func AppendFactory

func AppendFactory(parameters []core.Value) core.Filter

Creates an append filter

func Capitalize

func Capitalize(input interface{}, data map[string]interface{}) interface{}

Capitalizes words in the input sentence

func CapitalizeFactory

func CapitalizeFactory(parameters []core.Value) core.Filter

Creates a capitalize filter

func DateFactory

func DateFactory(parameters []core.Value) core.Filter

Creates an date filter

func DebugFactory

func DebugFactory(parameter []core.Value) core.Filter

func DefaultFactory

func DefaultFactory(parameters []core.Value) core.Filter

Creates a default filter

func DivideByFactory

func DivideByFactory(parameters []core.Value) core.Filter

func Downcase

func Downcase(input interface{}, data map[string]interface{}) interface{}

convert an input string to lowercase

func DowncaseFactory

func DowncaseFactory(parameters []core.Value) core.Filter

Creates a downcase filter

func Escape

func Escape(input interface{}, data map[string]interface{}) interface{}

Escapes html

func EscapeFactory

func EscapeFactory(parameters []core.Value) core.Filter

Creates an escape filter

func EscapeOnce

func EscapeOnce(input interface{}, data map[string]interface{}) interface{}

Escapes html that hasn't already been escaped

func EscapeOnceFactory

func EscapeOnceFactory(parameters []core.Value) core.Filter

creates an escapeonce filter

func First

func First(input interface{}, data map[string]interface{}) interface{}

get the first element of the passed in array

func FirstFactory

func FirstFactory(parameters []core.Value) core.Filter

Creates a first filter

func JoinFactory

func JoinFactory(parameters []core.Value) core.Filter

Creates a join filter

func Last

func Last(input interface{}, data map[string]interface{}) interface{}

get the last element of the passed in array

func LastFactory

func LastFactory(parameters []core.Value) core.Filter

Creates a last filter

func MinusFactory

func MinusFactory(parameters []core.Value) core.Filter

Creates a minus filter

func ModuloFactory

func ModuloFactory(parameters []core.Value) core.Filter

Creates a plus filter

func NewLineToBrFactory

func NewLineToBrFactory(parameters []core.Value) core.Filter

func Noop

func Noop(input interface{}, data map[string]interface{}) interface{}

a noop filter which returns the input as-is mostly used internally when the parameters don't make sense

func PlusFactory

func PlusFactory(parameters []core.Value) core.Filter

Creates a plus filter

func PrependFactory

func PrependFactory(parameters []core.Value) core.Filter

Creates an prepend filter

func RemoveFactory

func RemoveFactory(parameters []core.Value) core.Filter

func RemoveFirstFactory

func RemoveFirstFactory(parameters []core.Value) core.Filter

func ReplaceFactory

func ReplaceFactory(parameters []core.Value) core.Filter

func ReplaceFirstFactory

func ReplaceFirstFactory(parameters []core.Value) core.Filter

func Reverse

func Reverse(input interface{}, data map[string]interface{}) interface{}

reverses an array

func ReverseFactory

func ReverseFactory(parameters []core.Value) core.Filter

Creates a reverse filter

func Size

func Size(input interface{}, data map[string]interface{}) interface{}

Gets the size of a string or array

func SizeFactory

func SizeFactory(parameters []core.Value) core.Filter

Creates a size filter

func Sort

func Sort(input interface{}, data map[string]interface{}) interface{}

Sorts an array

func SortFactory

func SortFactory(parameters []core.Value) core.Filter

Creates a sort filter

func SplitFactory

func SplitFactory(parameters []core.Value) core.Filter

Creates a join filter

func StripHtmlFactory

func StripHtmlFactory(parameters []core.Value) core.Filter

func StripNewLinesFactory

func StripNewLinesFactory(parameters []core.Value) core.Filter

func TimesFactory

func TimesFactory(parameters []core.Value) core.Filter

Creates a time filter

func TruncateFactory

func TruncateFactory(parameters []core.Value) core.Filter

Creates an truncate filter

func TruncateWordsFactory

func TruncateWordsFactory(parameters []core.Value) core.Filter

Creates an truncatewords filter

func Upcase

func Upcase(input interface{}, data map[string]interface{}) interface{}

convert an input string to uppercase

func UpcaseFactory

func UpcaseFactory(parameters []core.Value) core.Filter

Creates a upcase filter

Types

type AppendFilter

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

func (*AppendFilter) Append

func (a *AppendFilter) Append(input interface{}, data map[string]interface{}) interface{}

type DateFilter

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

func (*DateFilter) ToString

func (d *DateFilter) ToString(input interface{}, data map[string]interface{}) interface{}

type DebugFilter

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

func (*DebugFilter) Debug

func (f *DebugFilter) Debug(input interface{}, data map[string]interface{}) interface{}

type DefaultFilter

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

func (*DefaultFilter) Default

func (d *DefaultFilter) Default(input interface{}, data map[string]interface{}) interface{}

type DynamicDivideByFilter

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

func (*DynamicDivideByFilter) DivideBy

func (t *DynamicDivideByFilter) DivideBy(input interface{}, data map[string]interface{}) interface{}

type DynamicMinusFilter

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

func (*DynamicMinusFilter) Minus

func (p *DynamicMinusFilter) Minus(input interface{}, data map[string]interface{}) interface{}

type DynamicModuloFilter

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

func (*DynamicModuloFilter) Mod

func (m *DynamicModuloFilter) Mod(input interface{}, data map[string]interface{}) interface{}

type DynamicPlusFilter

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

func (*DynamicPlusFilter) Plus

func (p *DynamicPlusFilter) Plus(input interface{}, data map[string]interface{}) interface{}

type DynamicTimesFilter

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

func (*DynamicTimesFilter) Times

func (t *DynamicTimesFilter) Times(input interface{}, data map[string]interface{}) interface{}

type FloatPlusFilter

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

Plus filter for float parameter

func (*FloatPlusFilter) Plus

func (p *FloatPlusFilter) Plus(input interface{}, data map[string]interface{}) interface{}

type FloatTimesFilter

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

func (*FloatTimesFilter) Times

func (t *FloatTimesFilter) Times(input interface{}, data map[string]interface{}) interface{}

Multiples two numbers

type IntModuloFilter

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

Plus filter for integer parameter

func (*IntModuloFilter) Mod

func (m *IntModuloFilter) Mod(input interface{}, data map[string]interface{}) interface{}

type IntPlusFilter

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

Plus filter for integer parameter

func (*IntPlusFilter) Plus

func (p *IntPlusFilter) Plus(input interface{}, data map[string]interface{}) interface{}

type IntTimesFilter

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

func (*IntTimesFilter) Times

func (t *IntTimesFilter) Times(input interface{}, data map[string]interface{}) interface{}

Multiples two numbers

type JoinFilter

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

func (*JoinFilter) Join

func (f *JoinFilter) Join(input interface{}, data map[string]interface{}) interface{}

join elements of the array with certain character between them

type PrependFilter

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

func (*PrependFilter) Prepend

func (a *PrependFilter) Prepend(input interface{}, data map[string]interface{}) interface{}

type ReplaceFilter

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

func (*ReplaceFilter) Replace

func (r *ReplaceFilter) Replace(input interface{}, data map[string]interface{}) interface{}

type ReplacePattern

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

Used by other filters

func (*ReplacePattern) Replace

func (r *ReplacePattern) Replace(input interface{}, data map[string]interface{}) interface{}

type SortableObject

type SortableObject struct {
	Underlying interface{}
	AsString   string
}

type SortableObjects

type SortableObjects []*SortableObject

func (SortableObjects) Len

func (s SortableObjects) Len() int

func (SortableObjects) Less

func (s SortableObjects) Less(i, j int) bool

func (SortableObjects) Swap

func (s SortableObjects) Swap(i, j int)

type SplitFilter

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

func (*SplitFilter) Split

func (f *SplitFilter) Split(input interface{}, data map[string]interface{}) interface{}

splits a value on the given value and returns an array

type TruncateFilter

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

func (*TruncateFilter) Truncate

func (t *TruncateFilter) Truncate(input interface{}, data map[string]interface{}) interface{}

type TruncateWordsFilter

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

func (*TruncateWordsFilter) Truncate

func (t *TruncateWordsFilter) Truncate(input interface{}, data map[string]interface{}) interface{}

Jump to

Keyboard shortcuts

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