Documentation
¶
Overview ¶
Package resource loads author manifests, validates self-contained resources, and compares UTF-8 output against expectations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchOutput ¶ added in v1.1.0
MatchOutput compares UTF-8 output using the given mode without modifying inputs. Exact compares bytes; easy compares whitespace-separated tokens on each line; sorted additionally ignores token order within each line, preserving duplicates. Easy and sorted recognize LF, CRLF and CR, and remove exactly one final newline. Nil slices are empty output. Invalid UTF-8 in either input is a mismatch, even in exact mode. An unknown mode (including the empty string) returns an error.
Types ¶
type ArtifactInput ¶
type ArtifactOutput ¶
type Artifacts ¶
type Artifacts struct {
Inputs []ArtifactInput `json:"inputs"`
Outputs []ArtifactOutput `json:"outputs"`
}
type Expected ¶
type Expected struct {
ExitCode *int `json:"exit-code"` // nil means the exit code is not checked.
Stdout *OutputExpectation `json:"stdout"`
Stderr *OutputExpectation `json:"stderr"`
}
type ImageBuild ¶
type ImageBuild struct {
Context string `json:"context"`
Dockerfile string `json:"dockerfile"`
Image string `json:"image"`
Platforms []string `json:"platforms"`
}
ImageBuild holds CI settings; build files are not read by this package.
type Manifest ¶
type Manifest struct {
Resources []Resource `json:"resources"`
SandboxImages map[string]ImageBuild `json:"sandbox-images"`
}
Manifest contains resolved resources in registration order and CI image build settings.
func LoadManifest ¶
LoadManifest validates manifest.yaml and resolves every registered resource. The caller must keep the input directory stable throughout the call.
type OutputExpectation ¶
type Resource ¶
type Resource struct {
Metadata Metadata `json:"metadata"`
RequiredFiles []string `json:"required-files"`
Workflows map[string]Workflow `json:"workflows"`
}
Resource contains resolved data and retains neither source paths nor file handles. Marshal it with encoding/json to save or distribute it.
func DecodeResource ¶
DecodeResource restores one resolved JSON resource, rejecting unknown fields and invalid runtime data. It does not read files or apply authoring defaults. Missing or null required-files is restored as an empty array.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
resource-ci
command
resource-ci runs this repository's GitHub validation and publication tasks.
|
resource-ci runs this repository's GitHub validation and publication tasks. |
|
resource-spec
command
|
|
|
internal
|
|
|
publishing
Package publishing implements this repository's GitHub publication workflow.
|
Package publishing implements this repository's GitHub publication workflow. |