templates

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedFileType = errors.New("unsupported file type")

Functions

func Build

func Build(data any, templateName, templateContent string) (string, error)

func BuildFile

func BuildFile(data any, templateName, templateContent, path string) error

func GenerateFile added in v0.1.1

func GenerateFile(
	defaultTemplatesMap map[string]string, fileName, fileTmpl, outputFile string, data any,
) error

func GenerateGoFiles

func GenerateGoFiles(
	defaultTemplatesMap map[string]TemplateMapValue, output string, codeConf map[string]Code, data any,
) error

Types

type Code

type Code struct {
	Tmpl    string
	Imports []string
}

type TemplateMapValue

type TemplateMapValue struct {
	TemplateName string
	Template     []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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