stacks

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CategoryFrontend = "frontend"
	CategoryStyling  = "styling"
	CategoryHTTP     = "http"
	CategoryDatabase = "database"
	CategoryAuth     = "auth"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature struct {
	ID          string
	CategoryID  string
	Name        string
	Description string
	Templates   []Template
	Directories []string
	Tags        []string
}

Feature enumerates a single modular capability that can be composed together.

func FeatureByID

func FeatureByID(id string) (Feature, bool)

FeatureByID returns the feature for the given identifier.

func FeaturesForCategory

func FeaturesForCategory(categoryID string) []Feature

FeaturesForCategory lists features for the supplied category ordered by name.

type FeatureCategory

type FeatureCategory struct {
	ID            string
	Name          string
	Description   string
	Required      bool
	AllowMultiple bool
}

FeatureCategory represents a group of compatible modular features.

func Categories

func Categories() []FeatureCategory

Categories returns a copy of the registered feature categories ordered for display.

type Selection

type Selection map[string][]string

Selection captures the chosen feature identifiers per category.

func CloneSelection

func CloneSelection(sel Selection) Selection

CloneSelection returns a deep copy of the provided selection to avoid mutation.

func DefaultSelection

func DefaultSelection() Selection

DefaultSelection returns a copy of the default feature selection.

func MergeSelections

func MergeSelections(a, b Selection) Selection

MergeSelections merges b into a, overriding category selections present in b.

func SelectionFromIDs

func SelectionFromIDs(values map[string]string) Selection

SelectionFromIDs normalizes per-category input ensuring each value is tracked as a slice.

type Stack

type Stack struct {
	ID          string
	Name        string
	Description string
	Templates   []Template
	Directories []string
	Tags        []string
	Features    []Feature
}

Stack describes the composed project blueprint built from modular features.

func Compose

func Compose(sel Selection) (Stack, error)

Compose builds a stack from the provided feature selection.

func (Stack) HasFeature

func (s Stack) HasFeature(id string) bool

HasFeature reports whether the stack includes the feature with the provided ID.

type Template

type Template struct {
	// Source is the path inside internal/templates that should be rendered.
	Source string
	// Destination is the relative path to write within the generated project.
	Destination string
	// Mode controls the filesystem permissions for the generated file.
	Mode fsFileMode
}

Template describes a templated file sourced from the embedded filesystem.

Jump to

Keyboard shortcuts

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