template

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAPI

func LoadAPI() (fs.FS, error)

LoadAPI returns the embedded API template filesystem rooted at "".

func OutputPath

func OutputPath(relPath string) string

OutputPath maps a template path to the generated project path.

func RenderFile

func RenderFile(tmplFS fs.FS, relPath string, data Data) ([]byte, error)

RenderFile executes a template file and returns rendered content.

Types

type Data

type Data struct {
	ProjectName  string
	ModulePath   string
	PackageName  string
	HTTPPort     int
	DatabaseName string
	GoVersion    string
	Author       string
}

Data is passed to text/template when rendering scaffold files.

func (Data) AUTHOR

func (d Data) AUTHOR() string

func (Data) DATABASE

func (d Data) DATABASE() string

func (Data) GO_VERSION

func (d Data) GO_VERSION() string

func (Data) HTTP_PORT

func (d Data) HTTP_PORT() int

func (Data) MODULE_NAME

func (d Data) MODULE_NAME() string

func (Data) PROJECT_NAME

func (d Data) PROJECT_NAME() string

Aliases exposes {{PROJECT_NAME}} style access inside templates.

Jump to

Keyboard shortcuts

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