Documentation
¶
Overview ¶
Package manifest provides types and validation for AILANG example manifests. The manifest system ensures documentation stays in sync with reality.
Package manifest provides the JSON schema definition for AILANG manifests.
Index ¶
- Constants
- type BrokenInfo
- type Environment
- type Example
- type Expected
- type Manifest
- func (m *Manifest) FindExample(path string) (*Example, bool)
- func (m *Manifest) GenerateREADMESection() string
- func (m *Manifest) GetBrokenExamples() []Example
- func (m *Manifest) GetWorkingExamples() []Example
- func (m *Manifest) Save(path string) error
- func (m *Manifest) UpdateSchemaDigest()
- func (m *Manifest) UpdateStatistics()
- func (m *Manifest) Validate() error
- type Mode
- type Statistics
- type Status
Constants ¶
const ExampleHeaderSchema = `` /* 663-byte string literal not displayed */
ExampleHeaderSchema defines the schema for example file headers
const ManifestSchemaJSON = `` /* 5598-byte string literal not displayed */
ManifestSchemaJSON defines the JSON schema for ailang.manifest/v1
const SchemaVersion = "ailang.manifest/v1"
SchemaVersion is the current manifest schema version
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrokenInfo ¶
type BrokenInfo struct {
Reason string `json:"reason"`
ErrorCode string `json:"error_code"`
Requires []string `json:"requires"`
TrackedIssue string `json:"tracked_issue,omitempty"`
}
BrokenInfo provides details about why an example is broken
type Environment ¶
type Environment struct {
Seed int `json:"seed"`
Locale string `json:"locale"`
Timezone string `json:"timezone"`
}
Environment captures execution environment settings
type Example ¶
type Example struct {
Path string `json:"path"`
Status Status `json:"status"`
Mode Mode `json:"mode"`
Tags []string `json:"tags,omitempty"`
Description string `json:"description,omitempty"`
Expected *Expected `json:"expected,omitempty"`
Environment *Environment `json:"environment,omitempty"`
Broken *BrokenInfo `json:"broken,omitempty"`
RequiresFeatures []string `json:"requires_features,omitempty"`
SkipReason string `json:"skip_reason,omitempty"`
}
Example represents a single example file in the manifest
type Expected ¶
type Expected struct {
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
ExitCode int `json:"exit_code"`
ErrorPattern string `json:"error_pattern,omitempty"`
}
Expected captures expected output for validation
type Manifest ¶
type Manifest struct {
Schema string `json:"schema"`
SchemaVersion string `json:"schema_version"`
SchemaDigest string `json:"schema_digest"`
GeneratedAt time.Time `json:"generated_at"`
Generator string `json:"generator"`
Examples []Example `json:"examples"`
Statistics Statistics `json:"statistics"`
}
Manifest represents the complete example manifest
func (*Manifest) FindExample ¶
FindExample locates an example by path
func (*Manifest) GenerateREADMESection ¶
GenerateREADMESection generates the status table for README
func (*Manifest) GetBrokenExamples ¶
GetBrokenExamples returns all broken examples
func (*Manifest) GetWorkingExamples ¶
GetWorkingExamples returns all working examples
func (*Manifest) UpdateSchemaDigest ¶
func (m *Manifest) UpdateSchemaDigest()
UpdateSchemaDigest recalculates the schema digest
func (*Manifest) UpdateStatistics ¶
func (m *Manifest) UpdateStatistics()
UpdateStatistics recalculates the statistics