generators

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 11 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, outputPath string) error

func CreateFilesMap

func CreateFilesMap(files []config.File) map[string]File

func GenerateFile

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

func GenerateFiles

func GenerateFiles(templatesMap map[string]TemplateMapValue, filesMap map[string]File, output string, data any) error

Types

type File

type File 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