tmpl

package
v0.1.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fields

type Fields map[string]interface{}

Fields ...

type Opt

type Opt func(*Opts)

Opt ...

func WithDisableReplaceNoValue

func WithDisableReplaceNoValue() Opt

WithDisableReplaceNoValue ...

func WithExtraFields

func WithExtraFields(fields TmplFields) Opt

WithExtraFields ...

func WithExtraFuncs

func WithExtraFuncs(funcs template.FuncMap) Opt

WithExtraFuncs ...

func WithFailOnMissing

func WithFailOnMissing() Opt

WithFailOnMissing ...

type Opts

type Opts struct {
	Fields                TmplFields
	Funcs                 template.FuncMap
	FailOnMissing         bool
	DisableReplaceNoValue bool
}

Opts ...

func NewOpts

func NewOpts() Opts

NewOpts ...

func (*Opts) Configure

func (o *Opts) Configure(opts ...Opt)

Configure os configuring the options.

type Template

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

Template ...

func New

func New(opts ...Opt) *Template

New ...

func (*Template) Apply

func (t *Template) Apply(s string) (string, error)

Apply ...

func (*Template) ApplyFile

func (t *Template) ApplyFile(in, out string) error

ApplyFile ...

type TmplFields

type TmplFields map[string]interface{}

TmplFields ...

Jump to

Keyboard shortcuts

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