github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/api/types/backend/build.go (about) 1 package backend // import "github.com/demonoid81/moby/api/types/backend" 2 3 import ( 4 "io" 5 6 "github.com/demonoid81/moby/api/types" 7 "github.com/demonoid81/moby/pkg/streamformatter" 8 specs "github.com/opencontainers/image-spec/specs-go/v1" 9 ) 10 11 // PullOption defines different modes for accessing images 12 type PullOption int 13 14 const ( 15 // PullOptionNoPull only returns local images 16 PullOptionNoPull PullOption = iota 17 // PullOptionForcePull always tries to pull a ref from the registry first 18 PullOptionForcePull 19 // PullOptionPreferLocal uses local image if it exists, otherwise pulls 20 PullOptionPreferLocal 21 ) 22 23 // ProgressWriter is a data object to transport progress streams to the client 24 type ProgressWriter struct { 25 Output io.Writer 26 StdoutFormatter io.Writer 27 StderrFormatter io.Writer 28 AuxFormatter *streamformatter.AuxFormatter 29 ProgressReaderFunc func(io.ReadCloser) io.ReadCloser 30 } 31 32 // BuildConfig is the configuration used by a BuildManager to start a build 33 type BuildConfig struct { 34 Source io.ReadCloser 35 ProgressWriter ProgressWriter 36 Options *types.ImageBuildOptions 37 } 38 39 // GetImageAndLayerOptions are the options supported by GetImageAndReleasableLayer 40 type GetImageAndLayerOptions struct { 41 PullOption PullOption 42 AuthConfig map[string]types.AuthConfig 43 Output io.Writer 44 Platform *specs.Platform 45 }