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

create

package
v1.234.0-nightly.41257... Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package create prepares scaffold-backed stack manifests without deploying resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	File, Target, Name, Template, Ref string
	Imports, Components               []string
	Values                            map[string]any
	Defaults                          bool
}

Options selects a scaffold and its stack-specific inputs.

type Output

type Output struct {
	Path string
	Kind OutputKind
}

Output is one file a plan writes.

type OutputKind

type OutputKind int

OutputKind classifies a file a plan writes.

const (
	// OutputManifest is the requested stack manifest.
	OutputManifest OutputKind = iota
	// OutputFile is any other file the scaffold renders.
	OutputFile
	// OutputRecord is the Atmos-owned generation record.
	OutputRecord
)

type Plan

type Plan struct {
	Root, Manifest string
	// Target is the project-relative directory destination; empty in file mode.
	Target string
	// Manifests lists discoverable generated stack manifests.
	Manifests  []string
	Generation *generatorui.CreationPlan
	Hooks      map[string]hooks.Hook
	// contains filtered or unexported fields
}

Plan contains the fully rendered files and the scaffold hooks that accompany them.

func Prepare

func Prepare(config *schema.AtmosConfiguration, opts *Options, renderer Renderer) (*Plan, error)

Prepare renders and validates a new stack before any generation hook or write.

func (*Plan) Apply

func (p *Plan) Apply(ctx context.Context, skip func(string) bool) error

Apply runs scaffold hooks around exclusive writes of exactly the previewed bytes.

func (*Plan) Outputs

func (p *Plan) Outputs() []Output

Outputs lists every file the plan writes, as project-relative slash paths, in write order.

func (*Plan) Preview

func (p *Plan) Preview(skip func(string) bool) error

Preview prints what Apply would do. Stdout carries file previews, each introduced by a comment naming its path and separated from the next by `---`, so it stays pipeable. Files may contain non-YAML content, so the stream is not guaranteed to be valid YAML. The generation record is only mentioned on stderr: it holds every answer and is not worth dumping.

type Renderer

type Renderer interface {
	SetEdition(string)
	PlanCreationQuiet(*templates.Configuration, string, bool, map[string]any) (*generatorui.CreationPlan, error)
}

Renderer is the shared scaffold questionnaire and rendering API. Stack create reports its own result, so it uses the quiet variant that omits the renderer's dry-run report.

Jump to

Keyboard shortcuts

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