layout

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package layout provides functionality to scaffold a new Go web application project

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scaffold

func Scaffold(
	targetDir, projectName, repo, database, cssFramework, version string,
	extensionNames []string,
) error

Scaffold TODO: figure out a way to have full repo path on init, i.e. github.com/mbvlabs/andurel breaks because go mod tidy will look up that path and not find it

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 Element

type Element struct {
	RootDir string
	SubDirs []Element
}

type Extension added in v0.37.2

type Extension struct {
	AppliedAt string `json:"appliedAt"`
}

type GoTool added in v0.37.2

type GoTool struct {
	Name    string
	Module  string
	Version string
}

type ScaffoldConfig added in v0.38.9

type ScaffoldConfig struct {
	ProjectName  string   `json:"projectName"`
	Repository   string   `json:"repository,omitempty"`
	Database     string   `json:"database"`
	CSSFramework string   `json:"cssFramework"`
	Extensions   []string `json:"extensions,omitempty"`
}

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
	// 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 NewBinaryTool(version string) *Tool

func NewBuiltTool added in v0.37.2

func NewBuiltTool(path string) *Tool

func NewGoTool added in v0.37.2

func NewGoTool(module, version string) *Tool

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.

Jump to

Keyboard shortcuts

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