Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver interface { // CreateContext creates a new evaluation context. CreateContext(*Environment) (DriverContext, error) }
Driver represents a template evaluation driver.
type DriverContext ¶
type DriverContext interface { // Eval evaluates the provided code and returns the result. Eval(code string) (string, error) }
DriverContext represents the context for template evaluation.
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment represents the environment for template evaluation.
func NewEnvironment ¶
NewEnvironment creates a new instance of Environment with the given parameters.
func (*Environment) Include ¶
func (env *Environment) Include(name string) string
Include includes the template specified by name.
func (*Environment) Props ¶
func (env *Environment) Props() map[string]any
Props returns the properties associated with the environment.
func (*Environment) RegisterHooks ¶ added in v0.2.0
func (env *Environment) RegisterHooks(register func(name string, value any) error) error
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator represents a template evaluator.
type HooksAPI ¶
type HooksAPI interface { // Include includes the specified template. Include(string) (string, error) // Render renders the specified template with the given properties. Render(string, map[string]any) (string, error) }
HooksAPI represents an interface for interacting with template hooks.
Click to show internal directories.
Click to hide internal directories.