templates

package
v0.0.0-...-ae6ecb5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderTemplate

func RenderTemplate(dest string, tpl *TemplateFS, vars map[string]string) error

RenderTemplate gera os arquivos do template no diretório de destino

Types

type TemplateFS

type TemplateFS struct {
	Meta  TemplateMeta
	Files map[string]string
}

func LoadEmbeddedTemplate

func LoadEmbeddedTemplate(name string) (*TemplateFS, error)

LoadEmbeddedTemplate carrega template embutido via embed.FS

func LoadTemplateFromDir

func LoadTemplateFromDir(dir string) (*TemplateFS, error)

LoadTemplateFromDir lê um template de um diretório que contém template.json e arquivos *.tmpl

type TemplateMeta

type TemplateMeta struct {
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	Variables   []string `json:"variables,omitempty"`
	PostInit    []string `json:"post_init,omitempty"`
}

Jump to

Keyboard shortcuts

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