template

package
v2.968.15 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: AGPL-3.0 Imports: 51 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 Config

type Config struct {
	TemplateDir               string   // The main template directory to use
	AdditionalSearchLocations []string // Additional directories to search for templates, templates/common is always added
	Subsystem                 *subsystem.Subsystem
	Debug                     bool
	DebugGojaPort             int // DAP debug port for goja JS runtime (0 = disabled)
	WriteFileFunc             WriteFileFunc
	ReadFileFunc              ReadFileFunc
	FileTracker               *filetracking.Tracker
	Ignore                    *filetracking.Ignore
	Comments                  *cms.CommentTracker
	Targeter                  Targeter
	Interopter                Interopter
	OutDir                    string
	ImportConfig              configuration.ImportConfig
	WatchTemplatesLocation    string
	Bucketer                  *buckettypes.Bucketer
}

type Engine

type Engine struct {
	*easytemplate.Engine
}

func New

func New(ctx context.Context, target types.Target, cfg Config) *Engine

type Interopter

type Interopter interface {
	ExecuteInterTemplateFunction(ctx context.Context, call easytemplate.CallContext, target types.Target, a *ast.AST, method string, args ...any) goja.Value
	ExecuteInterTemplateTarget(ctx context.Context, target string, outDir string, a *ast.AST, cfg map[string]any, enabledFeatures map[string]bool) error
	GetTargetDefaultTemplateConfig(ctx context.Context, target types.Target) (map[string]any, error)
}

type ReadFileFunc

type ReadFileFunc func(filename string) ([]byte, error)

type Targeter

type Targeter interface {
	GetTarget(ctx context.Context, target, outDir string) (types.Target, error)
}

type WarningLogger

type WarningLogger interface {
	LogWarning(ctx context.Context, msg string, err error)
}

type WriteFileFunc

type WriteFileFunc func(ctx context.Context, filename string, data []byte, perm fs.FileMode, checkExisting bool) error

Jump to

Keyboard shortcuts

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