engine

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action describes a filesystem operation.

const (
	ActionCreate Action = "create"
	ActionSkip   Action = "skip"
)

type Engine

type Engine struct{}

Engine renders embedded templates onto disk or produces a dry-run plan.

func NewEngine

func NewEngine() *Engine

NewEngine returns a template engine instance.

func (*Engine) Execute

func (e *Engine) Execute(opts Options) ([]PlanEntry, error)

Execute walks source templates and writes files or returns a plan.

type Options

type Options struct {
	SourceFS  fs.FS
	TargetDir string
	Data      template.Data
	DryRun    bool
}

Options controls template execution.

type PlanEntry

type PlanEntry struct {
	Path   string      `json:"path"`
	Action Action      `json:"action"`
	Mode   os.FileMode `json:"mode"`
	Reason string      `json:"reason,omitempty"`
}

PlanEntry describes one file that would be or was generated.

type Variables

type Variables struct {
	PROJECT_NAME string
	MODULE_NAME  string
	DATABASE     string
	AUTHOR       string
	HTTP_PORT    int
	GO_VERSION   string
	PackageName  string
}

Variables exposes template placeholders documented in ForgeKit specs.

func FromData

func FromData(d template.Data) Variables

FromData converts internal template data to public variable names.

func (Variables) ToTemplateData

func (v Variables) ToTemplateData() template.Data

ToTemplateData converts engine variables back to render data.

Jump to

Keyboard shortcuts

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