Documentation
¶
Overview ¶
Package scaffold provides CS_N custom service scaffolding for nself projects. It handles slot assignment, template rendering, and .env.dev updates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidLang ¶
IsValidLang reports whether lang is a supported template language.
func NextCSSlot ¶
NextCSSlot returns the next CS_N slot number (1-10) not already set in .env.dev. Returns an error if all 10 slots are in use. This is the exported variant of the internal nextFreeSlot helper (G-006).
func SupportedLangs ¶
func SupportedLangs() []string
SupportedLangs returns the list of supported language template names.
Types ¶
type Options ¶
type Options struct {
// Name is the service name (e.g. "my-api"). Validated against customServiceNameRe.
Name string
// Lang is one of: go, node, python, rust, other. Default "go".
Lang string
// ProjectDir is the nSelf project root. Defaults to the current working directory.
ProjectDir string
// Force allows overwriting an existing service directory.
Force bool
// DryRun prints what would be done without writing any files.
DryRun bool
}
Options configures a custom service scaffold run.
type Result ¶
type Result struct {
// Slot is the assigned CS_N slot number (1-10).
Slot int
// EnvKey is the env var name that was written (e.g. "CS_3").
EnvKey string
// EnvValue is the value that was written (e.g. "my-api:go:8003").
EnvValue string
// ServiceDir is the directory that was created.
ServiceDir string
// EnvFile is the .env file that was updated.
EnvFile string
// Files lists the relative (to ServiceDir) paths of emitted files.
Files []string
}
Result describes what was emitted.
Click to show internal directories.
Click to hide internal directories.