Documentation
¶
Overview ¶
Package scenario provides types and file-system access for scenario markdown files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var KnownStatuses = []Status{StatusIdea, StatusDraft, StatusActive, StatusOutdated}
KnownStatuses is the set of valid scenario status values.
Functions ¶
Types ¶
type Frontmatter ¶
type Frontmatter struct {
Status string `yaml:"status"`
}
Frontmatter represents the YAML frontmatter in a scenario file.
type Lister ¶
type Lister interface {
List(ctx context.Context) ([]*ScenarioFile, error)
Summary(ctx context.Context) (*Summary, error)
Find(ctx context.Context, id string) ([]*ScenarioFile, error)
}
Lister lists scenario files from a directory.
type ScenarioFile ¶
type ScenarioFile struct {
Path string
Name string // filename without .md extension, e.g. "001-workflow-direct"
Number int // numeric prefix, -1 if none
Frontmatter Frontmatter
Title string // text from the first "# " heading after frontmatter, empty if absent
RawContent []byte // full file bytes (used by show command to print entire file)
}
ScenarioFile represents a loaded scenario file.
func Load ¶
func Load(ctx context.Context, path string) (*ScenarioFile, error)
Load reads one scenario file from disk. On frontmatter parse failure the file is still returned with an empty Frontmatter — callers treat an empty/unrecognized status as unknown. Returns an error only if the file cannot be read at all.
type Status ¶
type Status string
Status represents the lifecycle state of a scenario.
const ( // StatusIdea indicates a rough concept not yet ready for execution. StatusIdea Status = "idea" // StatusDraft indicates a scenario that is written but not yet exercised. StatusDraft Status = "draft" // StatusActive indicates a scenario that is currently in use for regression coverage. StatusActive Status = "active" // StatusOutdated indicates a scenario that no longer reflects the current behavior. StatusOutdated Status = "outdated" )
Click to show internal directories.
Click to hide internal directories.