Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chapter ¶
type Chapter struct {
ID string // "00", "01", etc.
Name string // Display name
Slug string // URL slug, e.g. "00-setup"
Checks []Check // Validation steps for this chapter
}
Chapter represents a workshop chapter.
type ChapterStatus ¶
type ChapterStatus struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Unlocked bool `json:"unlocked"`
Completed bool `json:"completed"`
}
ChapterStatus is used in the API response.
type Check ¶
type Check struct {
Description string
Run func(context.Context) error
// Timeout is the maximum time allowed for a single attempt. Zero means no timeout.
Timeout time.Duration
// Retries is the number of additional attempts after the first failure. Zero means run once.
Retries int
// RetryDelay is the pause between retry attempts. Zero means no delay.
RetryDelay time.Duration
}
Check is a single validation step.
type CheckResult ¶
type CheckResult struct {
Description string `json:"description"`
Passed bool `json:"passed"`
Error string `json:"error,omitempty"`
}
CheckResult holds the outcome of a single check.
type CheckResultStore ¶
type CheckResultStore map[string][]CheckResult
CheckResultStore maps chapter IDs to their last check results.
type Config ¶
type Config struct {
Name string // Workshop display name
HomeDir string // State directory under home (default: ".worky")
Port int // Default HTTP port (default: 8080)
SiteFS fs.FS // Embedded Hugo output (optional; if nil, a built-in UI is served)
Chapters []Chapter
}
Config holds the workshop configuration provided by the creator.
type ProgressResponse ¶
type ProgressResponse struct {
Completed []string `json:"completed"`
Unlocked []string `json:"unlocked"`
Chapters []ChapterStatus `json:"chapters"`
}
ProgressResponse is the /api/progress response.
type State ¶
State holds the workshop progression state.
func (*State) IsCompleted ¶
IsCompleted reports whether a chapter is completed.
func (*State) IsUnlocked ¶
IsUnlocked reports whether a chapter is unlocked.
Click to show internal directories.
Click to hide internal directories.