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"
|
"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 {
|
type ComposeResult struct {
|
||||||
TreeID string `json:"tree_id"`
|
TreeID string `json:"tree_id"`
|
||||||
OutputID string `json:"output_id"`
|
OutputID string `json:"output_id"`
|
||||||
Build *struct {
|
Build *build `json:"build"`
|
||||||
Stages []struct {
|
Stages []stage `json:"stages"`
|
||||||
Name string `json:"name"`
|
Assembler *assembler `json:"assembler"`
|
||||||
Options json.RawMessage `json:"options"`
|
Success bool `json:"success"`
|
||||||
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"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cr *ComposeResult) Write(writer io.Writer) error {
|
func (cr *ComposeResult) Write(writer io.Writer) error {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue