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

describe

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package describe implements the stackit describe command for managing stack descriptions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(ctx context.Context, deps Deps, opts Options, handler Handler) error

Action implements the stackit describe command

func ParseEditorContent

func ParseEditorContent(content string) *git.StackDescription

ParseEditorContent parses the editor content into a StackDescription. Returns nil if the content is empty (abort).

func TruncateDescription

func TruncateDescription(s string, maxLen int) string

TruncateDescription truncates a description string for display. It returns the first line, truncated to maxLen characters if needed.

Types

type Deps added in v0.30.1

type Deps struct {
	Engine Engine
	Out    output.Output
}

Deps are the collaborators describe needs. Adapters build them from their own runtime state; the action never sees bootstrap types.

type Engine added in v0.30.1

type Engine interface {
	actions.MetadataPushEngine
	engine.BranchLookup
	CurrentBranch(ctx context.Context) *engine.Branch
	IsTrunk(branch engine.Branch) bool
	Graph(ctx context.Context, strategy engine.SortStrategy) *engine.StackGraph
	GetStackRootForBranch(branch engine.Branch) string
	GetStackDescription(ctx context.Context, branch engine.Branch) *git.StackDescription
	SetStackDescription(ctx context.Context, branch engine.Branch, desc *git.StackDescription) error
	ClearStackDescription(ctx context.Context, branch engine.Branch) error
	MarkBranchesForPRBodyUpdate(ctx context.Context, branchNames []string) error
}

Engine lists exactly the engine methods describe calls.

type Handler

type Handler interface {
	// Cleanup restores terminal state (may be no-op)
	Cleanup()

	// IsInteractive returns true if the handler supports interactive prompts
	IsInteractive() bool
}

Handler receives events from describe action

type NullHandler

type NullHandler struct {
	handler.NullBase
}

NullHandler is a no-op handler for when nil is passed. It embeds handler.NullBase for Cleanup() and IsInteractive().

type Options

type Options struct {
	Title       string // Set title directly (non-interactive)
	Description string // Set description directly (non-interactive)
	Clear       bool   // Remove the stack description
	Show        bool   // Display the current description
}

Options contains options for the describe command

Jump to

Keyboard shortcuts

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