osbuild2: small code reorganisation
Move main type to the top of the file
This commit is contained in:
parent
10eb0d65a1
commit
5f8bd4fd6e
1 changed files with 8 additions and 8 deletions
|
|
@ -9,6 +9,14 @@ import (
|
|||
"github.com/osbuild/osbuild-composer/internal/osbuild1"
|
||||
)
|
||||
|
||||
type Result struct {
|
||||
Type string `json:"type"`
|
||||
Success bool `json:"success"`
|
||||
Error json.RawMessage `json:"error"`
|
||||
Log map[string]PipelineResult `json:"log"`
|
||||
Metadata map[string]PipelineMetadata `json:"metadata"`
|
||||
}
|
||||
|
||||
type PipelineResult []StageResult
|
||||
|
||||
type StageResult struct {
|
||||
|
|
@ -85,14 +93,6 @@ func (md PipelineMetadata) UnmarshalJSON(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
type Result struct {
|
||||
Type string `json:"type"`
|
||||
Success bool `json:"success"`
|
||||
Error json.RawMessage `json:"error"`
|
||||
Log map[string]PipelineResult `json:"log"`
|
||||
Metadata map[string]PipelineMetadata `json:"metadata"`
|
||||
}
|
||||
|
||||
func (res *Result) UnmarshalJSON(data []byte) error {
|
||||
// detect if the input is v1 result
|
||||
if v1Result, err := isV1Result(data); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue