Documentation
¶
Index ¶
- func Apply(field string, values any) (string, error)
- func ApplyAndSet(field *string, values any) (err error)
- type Option
- type Processor
- func (p *Processor) AddFuncs(funcs ...template.FuncMap)
- func (p *Processor) AddValue(key string, value any)
- func (p *Processor) AddValues(values ...map[string]any)
- func (p *Processor) Apply(templateStr string) (string, error)
- func (p *Processor) ApplyAndSet(field *string) error
- func (p *Processor) Reset()
- func (p *Processor) Values() map[string]any
- func (p *Processor) WithOptions(opts ...Option) *Processor
- func (p *Processor) WithValues(values ...map[string]any) *Processor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyAndSet ¶
Types ¶
type Option ¶ added in v0.0.13
type Option func(*Processor)
Option is a function that modifies a Processor.
func WithMissingKeyDefault ¶ added in v0.0.13
func WithMissingKeyDefault() Option
WithMissingKeyDefault sets missing keys to display "<no value>".
func WithMissingKeyError ¶ added in v0.0.13
func WithMissingKeyError() Option
WithMissingKeyError makes missing keys return an error.
func WithMissingKeyZero ¶ added in v0.0.13
func WithMissingKeyZero() Option
WithMissingKeyZero sets missing keys to use the zero value.
func WithSlimSprig ¶ added in v0.0.13
func WithSlimSprig() Option
WithSlimSprig adds slim-sprig functions.
type Processor ¶ added in v0.0.13
type Processor struct {
// contains filtered or unexported fields
}
Processor handles template processing with configurable options.
func (*Processor) Apply ¶ added in v0.0.13
Apply processes a template string with the accumulated values.
func (*Processor) ApplyAndSet ¶ added in v0.0.13
func (*Processor) Reset ¶ added in v0.0.13
func (p *Processor) Reset()
Reset clears all accumulated values.
func (*Processor) WithOptions ¶ added in v0.0.13
Click to show internal directories.
Click to hide internal directories.