template

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPlaceholder

func IsPlaceholder(s any) bool

func Trim

func Trim(s string) string

Types

type Template

type Template struct {
	Value any
}

Template is used to resolve placeholders in a map[string]any or string value It does to by checking in a `lookUp` map for the value of the placeholder The placeholder is defined by the pattern `$<placeholder>`

func New

func New(value any) Template

func (Template) Apply

func (t Template) Apply(lookUp map[string]any) (any, error)

func (Template) GetAllPlaceholders

func (t Template) GetAllPlaceholders() []string

func (Template) IsMap

func (t Template) IsMap() bool

func (Template) IsString

func (t Template) IsString() bool

type TemplateResolver

type TemplateResolver func(lookUp map[string]any, key string) (any, error)

Jump to

Keyboard shortcuts

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