template

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

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
	PostgresHostPort   int
	DatabaseName       string
	GoVersion          string
	Author             string
	UseExistingDB      bool
	ExternalDBHost     string
	ExternalDBPort     int
	ExternalDBUser     string
	ExternalDBPassword string
	ExternalDBName     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) EXTERNAL_DB_HOST added in v0.3.0

func (d Data) EXTERNAL_DB_HOST() string

func (Data) EXTERNAL_DB_NAME added in v0.3.0

func (d Data) EXTERNAL_DB_NAME() string

func (Data) EXTERNAL_DB_PASSWORD added in v0.3.0

func (d Data) EXTERNAL_DB_PASSWORD() string

func (Data) EXTERNAL_DB_PORT added in v0.3.0

func (d Data) EXTERNAL_DB_PORT() int

func (Data) EXTERNAL_DB_USER added in v0.3.0

func (d Data) EXTERNAL_DB_USER() 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) POSTGRES_HOST_PORT added in v0.3.0

func (d Data) POSTGRES_HOST_PORT() int

func (Data) PROJECT_NAME

func (d Data) PROJECT_NAME() string

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

func (Data) USE_EXISTING_DB added in v0.3.0

func (d Data) USE_EXISTING_DB() bool

Jump to

Keyboard shortcuts

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