parameters

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExpressionVarMatchRegex = regexp.MustCompile("^\\$\\{\\{[^\\}]+\\}\\}$")

ExpressionVarMatchRegex is the regex to check if a value matches the kiosk var format

View Source
var VarMatchRegex = regexp.MustCompile("(\\$+?\\{[^\\}]+\\})")

VarMatchRegex is the regex to check if a value matches the kiosk var format

Functions

func ParseString

func ParseString(value string, replace ReplaceVarFn) (interface{}, error)

ParseString parses a given string, calls replace var on found variables and returns the replaced string

func Walk

func Walk(d map[interface{}]interface{}, replace ReplaceFn) error

Walk walks over an interface and replaces keys that match the match function with the replace function

func WalkStringMap

func WalkStringMap(d map[string]interface{}, replace ReplaceFn) error

WalkStringMap walks over an interface and replaces keys that match the match function with the replace function

Types

type ReplaceFn

type ReplaceFn func(value string) (interface{}, error)

ReplaceFn defines the replace function

type ReplaceVarFn

type ReplaceVarFn func(value string) (string, error)

ReplaceVarFn defines the replace function

Jump to

Keyboard shortcuts

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