Separate nested structure in compose_result.go
This separated the nested structure into their own struct types.
This commit is contained in:
parent
28d0c4f640
commit
2b87ca41b5
1 changed files with 26 additions and 25 deletions
|
|
@ -6,32 +6,33 @@ import (
|
|||
"io"
|
||||
)
|
||||
|
||||
type assembler struct {
|
||||
Name string `json:"name"`
|
||||
Options json.RawMessage `json:"options"`
|
||||
Success bool `json:"success"`
|
||||
Output string `json:"output"`
|
||||
}
|
||||
|
||||
type stage struct {
|
||||
Name string `json:"name"`
|
||||
Options json.RawMessage `json:"options"`
|
||||
Success bool `json:"success"`
|
||||
Output string `json:"output"`
|
||||
}
|
||||
|
||||
type build struct {
|
||||
Stages []stage `json:"stages"`
|
||||
TreeID string `json:"tree_id"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type ComposeResult struct {
|
||||
TreeID string `json:"tree_id"`
|
||||
OutputID string `json:"output_id"`
|
||||
Build *struct {
|
||||
Stages []struct {
|
||||
Name string `json:"name"`
|
||||
Options json.RawMessage `json:"options"`
|
||||
Success bool `json:"success"`
|
||||
Output string `json:"output"`
|
||||
} `json:"stages"`
|
||||
TreeID string `json:"tree_id"`
|
||||
Success bool `json:"success"`
|
||||
} `json:"build"`
|
||||
Stages []struct {
|
||||
Name string `json:"name"`
|
||||
Options json.RawMessage `json:"options"`
|
||||
Success bool `json:"success"`
|
||||
Output string `json:"output"`
|
||||
} `json:"stages"`
|
||||
Assembler *struct {
|
||||
Name string `json:"name"`
|
||||
Options json.RawMessage `json:"options"`
|
||||
Success bool `json:"success"`
|
||||
Output string `json:"output"`
|
||||
} `json:"assembler"`
|
||||
Success bool `json:"success"`
|
||||
TreeID string `json:"tree_id"`
|
||||
OutputID string `json:"output_id"`
|
||||
Build *build `json:"build"`
|
||||
Stages []stage `json:"stages"`
|
||||
Assembler *assembler `json:"assembler"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
func (cr *ComposeResult) Write(writer io.Writer) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue