github.com/pdmccormick/importable-docker-buildx@v0.0.0-20240426161518-e47091289030/controller/pb/cache.go (about) 1 package pb 2 3 import "github.com/moby/buildkit/client" 4 5 func CreateCaches(entries []*CacheOptionsEntry) []client.CacheOptionsEntry { 6 var outs []client.CacheOptionsEntry 7 if len(entries) == 0 { 8 return nil 9 } 10 for _, entry := range entries { 11 out := client.CacheOptionsEntry{ 12 Type: entry.Type, 13 Attrs: map[string]string{}, 14 } 15 for k, v := range entry.Attrs { 16 out.Attrs[k] = v 17 } 18 outs = append(outs, out) 19 } 20 return outs 21 }