2018-07-11 23:51:41 +00:00
|
|
|
package frontend
|
|
|
|
|
2019-12-09 20:50:21 +00:00
|
|
|
import (
|
|
|
|
"github.com/moby/buildkit/solver"
|
|
|
|
)
|
2018-07-11 23:51:41 +00:00
|
|
|
|
|
|
|
type Result struct {
|
2020-02-04 23:00:44 +00:00
|
|
|
Ref solver.ResultProxy
|
|
|
|
Refs map[string]solver.ResultProxy
|
2018-07-11 23:51:41 +00:00
|
|
|
Metadata map[string][]byte
|
|
|
|
}
|
|
|
|
|
2020-02-04 23:00:44 +00:00
|
|
|
func (r *Result) EachRef(fn func(solver.ResultProxy) error) (err error) {
|
2018-07-11 23:51:41 +00:00
|
|
|
if r.Ref != nil {
|
|
|
|
err = fn(r.Ref)
|
|
|
|
}
|
|
|
|
for _, r := range r.Refs {
|
|
|
|
if r != nil {
|
|
|
|
if err1 := fn(r); err1 != nil && err == nil {
|
|
|
|
err = err1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|