starter

package
v0.3.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package starter creates consumer-owned Modary projects from visible, create-only Profile templates.

Stability: alpha. Consumers should pin an exact pre-v1 Modary version.

Index

Constants

View Source
const CommandUsage = `` /* 158-byte string literal not displayed */

CommandUsage is the global create-only Starter command help.

View Source
const (
	// DefaultModaryVersion is written by the current Starter when a caller does
	// not select another exact framework version.
	DefaultModaryVersion = "v0.3.0-alpha.2"
)

Variables

View Source
var (
	// ErrContextRequired reports a nil creation or command context.
	ErrContextRequired = errors.New("starter context is required")
	// ErrInvalidOptions reports invalid project identity, module, or Profile input.
	ErrInvalidOptions = errors.New("starter options are invalid")
	// ErrDestinationNotEmpty reports that create-only ownership cannot be established.
	ErrDestinationNotEmpty = errors.New("starter destination is not empty")
	// ErrUnsafeDestination reports a symlink or non-directory destination.
	ErrUnsafeDestination = errors.New("starter destination is unsafe")
)
View Source
var (
	// ErrUsage identifies invalid global command syntax.
	ErrUsage = errors.New("starter command usage is invalid")
)

Functions

func Run

func Run(ctx context.Context, args []string, options Options) error

Run dispatches the create-only global Starter command.

Types

type Component

type Component string

Component identifies one optional Profile-owned component selection.

const (
	// ComponentTasks adds River-backed task inspection to the Admin Profile.
	ComponentTasks Component = "tasks"
	// ComponentAudit adds scope-bound audit inspection to the Admin Profile.
	ComponentAudit Component = "audit"
	// ComponentOIDC replaces the generated local-password login surface with
	// the official OIDC component and redirect contribution.
	ComponentOIDC Component = "oidc"
	// ComponentOTel adds the independently versioned OTLP traces and metrics
	// adapter without changing the generated Admin product surface.
	ComponentOTel Component = "otel"
)

type CreateOptions

type CreateOptions struct {
	Destination   string
	ModulePath    string
	Name          string
	Profile       Profile
	ModaryVersion string
	ModaryReplace string
	Components    []Component
}

CreateOptions defines one initial project rendering. ModaryReplace is an explicit development and conformance hook; released projects normally leave it empty and use the exact ModaryVersion.

type Options

type Options struct {
	Stdout        io.Writer
	Stderr        io.Writer
	ModaryVersion string
	ModaryReplace string
}

Options configures the global Starter command. ModaryVersion and ModaryReplace are release/conformance inputs rather than generated runtime configuration.

type Profile

type Profile string

Profile identifies a visible source preset used only during project creation.

const (
	// ProfileAPI creates the database-free standard Go HTTP application.
	ProfileAPI Profile = "api"
	// ProfileAdmin creates the optional administrative application.
	ProfileAdmin Profile = "admin"
	// ProfileGoverned creates the optional governed-operation application.
	ProfileGoverned Profile = "governed"
)

type Result

type Result struct {
	Destination string      `json:"destination"`
	Profile     Profile     `json:"profile"`
	Files       []string    `json:"files"`
	Components  []Component `json:"components,omitempty"`
}

Result identifies the created project and its sorted consumer-owned files.

func Create

func Create(ctx context.Context, options CreateOptions) (Result, error)

Create renders and writes a complete Profile only after all input and templates validate. It accepts a nonexistent or empty real directory and never merges with, replaces, or patches an existing file.

Jump to

Keyboard shortcuts

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