Documentation
¶
Overview ¶
Package layout provides functionality to scaffold a new Go web application project
Index ¶
- Variables
- func GetExpectedTools(config *ScaffoldConfig) map[string]*Tool
- func GetRunToolVersion() string
- func Scaffold(targetDir, projectName, database, cssFramework, version string, ...) error
- type AndurelLock
- type Element
- type Extension
- type GoTool
- type ScaffoldConfig
- type TemplateData
- type TmplTarget
- type TmplTargetPath
- type Tool
Constants ¶
This section is empty.
Variables ¶
var DefaultGoTools = []GoTool{ {Name: "templ", Module: "github.com/a-h/templ/cmd/templ", Version: versions.Templ}, {Name: "sqlc", Module: "github.com/sqlc-dev/sqlc/cmd/sqlc", Version: versions.Sqlc}, {Name: "goose", Module: "github.com/pressly/goose/v3/cmd/goose", Version: versions.Goose}, {Name: "mailpit", Module: "github.com/axllent/mailpit", Version: versions.Mailpit}, {Name: "usql", Module: "github.com/xo/usql", Version: versions.Usql}, {Name: "dblab", Module: "github.com/danvergara/dblab", Version: versions.Dblab}, {Name: "shadowfax", Module: "github.com/mbvlabs/shadowfax", Version: versions.Shadowfax}, }
Functions ¶
func GetExpectedTools ¶ added in v1.0.0
func GetExpectedTools(config *ScaffoldConfig) map[string]*Tool
GetExpectedTools returns the list of tools that should exist for a given scaffold config
func GetRunToolVersion ¶ added in v1.0.0
func GetRunToolVersion() string
GetRunToolVersion returns the version of the run tool
Types ¶
type AndurelLock ¶ added in v0.32.2
type AndurelLock struct {
Version string `json:"version"`
Extensions map[string]*Extension `json:"extensions,omitempty"`
Tools map[string]*Tool `json:"tools"`
ScaffoldConfig *ScaffoldConfig `json:"scaffoldConfig,omitempty"`
}
func NewAndurelLock ¶ added in v0.32.2
func NewAndurelLock(version string) *AndurelLock
func ReadLockFile ¶ added in v0.32.2
func ReadLockFile(targetDir string) (*AndurelLock, error)
func (*AndurelLock) AddExtension ¶ added in v0.37.2
func (l *AndurelLock) AddExtension(name, appliedAt string)
func (*AndurelLock) AddTool ¶ added in v0.37.2
func (l *AndurelLock) AddTool(name string, tool *Tool)
func (*AndurelLock) Sync ¶ added in v0.37.2
func (l *AndurelLock) Sync(targetDir string, silent bool) error
func (*AndurelLock) WriteLockFile ¶ added in v0.32.2
func (l *AndurelLock) WriteLockFile(targetDir string) error
type ScaffoldConfig ¶ added in v0.38.9
type TemplateData ¶
type TemplateData struct {
AppName string
ProjectName string
ModuleName string
Database string // Always "postgresql"
CSSFramework string
GoVersion string
SessionKey string
SessionEncryptionKey string
TokenSigningKey string
Pepper string
Extensions []string
RunToolVersion string // Version of the run built tool
// contains filtered or unexported fields
}
TemplateData carries the values available to base templates and extension contributions. It wraps a Blueprint for structured data alongside project-level metadata.
func (*TemplateData) Blueprint ¶
func (td *TemplateData) Blueprint() *blueprint.Blueprint
Blueprint returns the underlying blueprint. If not yet initialized, creates a new one.
func (*TemplateData) Builder ¶
func (td *TemplateData) Builder() *blueprint.Builder
Builder returns a builder adapter wrapping the template data's blueprint. The return type satisfies the extensions.Builder interface.
func (*TemplateData) DatabaseDialect ¶
func (td *TemplateData) DatabaseDialect() string
DatabaseDialect returns the configured database, which is always PostgreSQL.
func (*TemplateData) GetModuleName ¶
func (td *TemplateData) GetModuleName() string
GetModuleName returns the module name for the project.
func (*TemplateData) SetBlueprint ¶
func (td *TemplateData) SetBlueprint(bp *blueprint.Blueprint)
SetBlueprint sets the blueprint for this template data.
type TmplTarget ¶
type TmplTarget string
type TmplTargetPath ¶
type TmplTargetPath string
type Tool ¶ added in v0.37.2
type Tool struct {
Source string `json:"source"`
Version string `json:"version,omitempty"`
Module string `json:"module,omitempty"`
Path string `json:"path,omitempty"`
}
func NewBinaryTool ¶ added in v0.37.2
func NewBuiltTool ¶ added in v0.37.2
Directories
¶
| Path | Synopsis |
|---|---|
|
Package blueprint provides structured types for scaffold configuration that support additive merges from multiple extensions without conflicts.
|
Package blueprint provides structured types for scaffold configuration that support additive merges from multiple extensions without conflicts. |
|
Package cmds holds commands being used for scaffolding
|
Package cmds holds commands being used for scaffolding |
|
Package extensions provides the framework for registering and applying extensions to the scaffold generation process.
|
Package extensions provides the framework for registering and applying extensions to the scaffold generation process. |