entity

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AstTransformer

type AstTransformer struct {
	// Holds name and source of template definitions not found during the first
	// AST transformation pass.
	TransformNotFound map[string]*valueobject.State
}

type Context

type Context struct {
	TemplateNotFound map[string]bool
	// contains filtered or unexported fields
}

func ApplyTemplateTransformers

func ApplyTemplateTransformers(t *valueobject.State, lookupFn func(name string) *valueobject.State) (*Context, error)

type Executor

type Executor struct {
	texttemplate.Executor
}

func (*Executor) ExecuteWithContext

func (t *Executor) ExecuteWithContext(ctx context.Context, templ template.Preparer, wr io.Writer, data any) error

type GoTemplateCallback

type GoTemplateCallback struct {
	Funcs map[string]reflect.Value
}

func (*GoTemplateCallback) BeforeExec

func (t *GoTemplateCallback) BeforeExec(ctx context.Context, tmpl texttemplate.Preparer)

func (*GoTemplateCallback) GetFunc

func (t *GoTemplateCallback) GetFunc(ctx context.Context, tmpl texttemplate.Preparer, name string) (fn reflect.Value, firstArg reflect.Value, found bool)

func (*GoTemplateCallback) GetMapValue

func (t *GoTemplateCallback) GetMapValue(ctx context.Context, tmpl texttemplate.Preparer, receiver, key reflect.Value) (reflect.Value, bool)

func (*GoTemplateCallback) GetMethod

func (t *GoTemplateCallback) GetMethod(ctx context.Context, tmpl texttemplate.Preparer, receiver reflect.Value, name string) (method reflect.Value, firstArg reflect.Value)

func (*GoTemplateCallback) OnCalled

func (t *GoTemplateCallback) OnCalled(ctx context.Context, tmpl texttemplate.Preparer, name string, args []reflect.Value, result reflect.Value)

type Lookup

type Lookup struct {
	BaseOf *valueobject.BaseOf
	Funcsv map[string]reflect.Value
}

func (*Lookup) GetFunc

func (t *Lookup) GetFunc(name string) (reflect.Value, bool)

type Namespace

type Namespace struct {
	*valueobject.StateMap
}

func (*Namespace) Lookup

func (t *Namespace) Lookup(name string) (template.Preparer, bool)

type Parser

type Parser struct {
	PrototypeText *texttemplate.Template
	PrototypeHTML *htmltemplate.Template

	Ast *AstTransformer

	*sync.RWMutex
	// contains filtered or unexported fields
}

func (*Parser) MarkReady

func (t *Parser) MarkReady() error

func (*Parser) Parse

func (*Parser) ParseOverlap

func (t *Parser) ParseOverlap(overlay, base valueobject.TemplateInfo) (*valueobject.State, bool, error)

func (*Parser) ParseWithLock

func (t *Parser) ParseWithLock(name, tpl string) (template.Preparer, error)

func (*Parser) Transform

func (t *Parser) Transform(ns *Namespace, ts *valueobject.State) error

type Shortcode

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

func (*Shortcode) LookupVariant

func (t *Shortcode) LookupVariant(name string, variants template.Variants) (template.Preparer, bool, bool)

func (*Shortcode) LookupVariants

func (t *Shortcode) LookupVariants(name string) []template.Preparer

LookupVariants returns all variants of name, nil if none found.

type Template

type Template struct {
	*Executor
	*Lookup

	Parser *Parser

	Main *Namespace
	Fs   template.Fs

	*Shortcode

	Log loggers.Logger

	LayoutTemplateCache map[string]valueobject.LayoutCacheEntry
	// contains filtered or unexported fields
}

func (*Template) Execute

func (t *Template) Execute(ctx context.Context, name string, data any) (tmpl string, res any, err error)

func (*Template) LoadEmbedded

func (t *Template) LoadEmbedded() error

func (*Template) LoadTemplates

func (t *Template) LoadTemplates() error

func (*Template) LookupLayout

func (t *Template) LookupLayout(names []string) (template.Preparer, bool, error)

func (*Template) MarkReady

func (t *Template) MarkReady() error

func (*Template) Parse

func (t *Template) Parse(name, tpl string) (template.Preparer, error)

func (*Template) PostTransform

func (t *Template) PostTransform() error

Jump to

Keyboard shortcuts

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