template

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(f string, d interface{}) ([]byte, error)

Types

type Config added in v1.22.0

type Config struct {
	Funcs template.FuncMap
}

func (Config) WithOptions added in v1.22.0

func (c Config) WithOptions(opts []Option) Config

type Option added in v1.22.0

type Option func(Config) Config

func WithFuncs added in v1.22.0

func WithFuncs(f template.FuncMap) Option

type Template

type Template struct {
	*template.Template
}

func Parse

func Parse(f string, opts ...Option) (*Template, error)

func ParseWithConfig added in v1.22.0

func ParseWithConfig(f string, conf Config) (*Template, error)

func (*Template) Exec

func (t *Template) Exec(d interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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