Help us shape the future of Go! Take the 2026 Go Developer Survey

templates

package
v2.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	ProjectName        string
	BinaryName         string
	WailsVersion       string
	NPMProjectName     string
	AuthorName         string
	AuthorEmail        string
	AuthorNameAndEmail string
	WailsDirectory     string
	GoSDKPath          string
	WindowsFlags       string
	CGOEnabled         string
	OutputFile         string
}

Data contains the data we wish to embed during template installation

type Options

type Options struct {
	ProjectName         string
	TemplateName        string
	BinaryName          string
	TargetDir           string
	Logger              *clilogger.CLILogger
	PathToDesktopBinary string
	PathToServerBinary  string
	InitGit             bool
	AuthorName          string
	AuthorEmail         string
	IDE                 string
	ProjectNameFilename string // The project name but as a valid filename
	WailsVersion        string
	GoSDKPath           string
	WindowsFlags        string
	CGOEnabled          string
	CGOLDFlags          string
	OutputFile          string
}

Options for installing a template

type Template

type Template struct {
	// Template details
	Name        string `json:"name"`
	ShortName   string `json:"shortname"`
	Author      string `json:"author"`
	Description string `json:"description"`
	HelpURL     string `json:"helpurl"`

	// Other data
	FS gofs.FS `json:"-"`
}

Template holds data relating to a template including the metadata stored in template.json

func Install

func Install(options *Options) (bool, *Template, error)

Install the given template. Returns true if the template is remote.

func List

func List() ([]Template, error)

List returns the list of available templates

Directories

Path Synopsis
plain command
templates
lit command
lit-ts command
plain command
preact command
preact-ts command
react command
react-ts command
svelte command
svelte-ts command
vanilla command
vanilla-ts command
vue command
vue-ts command

Jump to

Keyboard shortcuts

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