llb

package
v0.0.0-...-0553404 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IgnoreCache = metadataOptFunc(func(md *OpMetadata) {
	md.IgnoreCache = true
})

Functions

func Readonly

func Readonly(m *mount)

func WriteTo

func WriteTo(def *Definition, w io.Writer) error

Types

type Definition

type Definition struct {
	Def      [][]byte
	Metadata map[digest.Digest]OpMetadata
}

Definition is the LLB definition structure with per-vertex metadata entries Corresponds to the Definition structure defined in solver/pb.Definition.

func ReadFrom

func ReadFrom(r io.Reader) (*Definition, error)

func (*Definition) FromPB

func (def *Definition) FromPB(x *pb.Definition)

func (*Definition) ToPB

func (def *Definition) ToPB() *pb.Definition

type EnvList

type EnvList []KeyValue

func (EnvList) AddOrReplace

func (e EnvList) AddOrReplace(k, v string) EnvList

func (EnvList) Delete

func (e EnvList) Delete(k string) EnvList

func (EnvList) Get

func (e EnvList) Get(k string) (string, bool)

func (EnvList) Index

func (e EnvList) Index(k string) (int, bool)

func (EnvList) ToArray

func (e EnvList) ToArray() []string

type ExecInfo

type ExecInfo struct {
	State          State
	Mounts         []MountInfo
	ReadonlyRootFS bool
	// contains filtered or unexported fields
}

func (*ExecInfo) ApplyMetadata

func (mw *ExecInfo) ApplyMetadata(f func(m *OpMetadata))

func (*ExecInfo) Metadata

func (mw *ExecInfo) Metadata() OpMetadata

type ExecOp

type ExecOp struct {
	// contains filtered or unexported fields
}

func NewExecOp

func NewExecOp(root Output, meta Meta, readOnly bool, md OpMetadata) *ExecOp

func (*ExecOp) AddMount

func (e *ExecOp) AddMount(target string, source Output, opt ...MountOption) Output

func (*ExecOp) GetMount

func (e *ExecOp) GetMount(target string) Output

func (*ExecOp) Inputs

func (e *ExecOp) Inputs() (inputs []Output)

func (*ExecOp) Marshal

func (e *ExecOp) Marshal() (digest.Digest, []byte, *OpMetadata, error)

func (*ExecOp) Output

func (e *ExecOp) Output() Output

func (*ExecOp) Validate

func (e *ExecOp) Validate() error

type ExecState

type ExecState struct {
	State
	// contains filtered or unexported fields
}

func (ExecState) AddMount

func (e ExecState) AddMount(target string, source State, opt ...MountOption) State

func (ExecState) GetMount

func (e ExecState) GetMount(target string) State

func (ExecState) Root

func (e ExecState) Root() State

type GitInfo

type GitInfo struct {
	KeepGitDir bool
	// contains filtered or unexported fields
}

func (*GitInfo) ApplyMetadata

func (mw *GitInfo) ApplyMetadata(f func(m *OpMetadata))

func (*GitInfo) Metadata

func (mw *GitInfo) Metadata() OpMetadata

type GitOption

type GitOption interface {
	SetGitOption(*GitInfo)
}

func KeepGitDir

func KeepGitDir() GitOption

type HTTPInfo

type HTTPInfo struct {
	Checksum digest.Digest
	Filename string
	Perm     int
	UID      int
	GID      int
	// contains filtered or unexported fields
}

func (*HTTPInfo) ApplyMetadata

func (mw *HTTPInfo) ApplyMetadata(f func(m *OpMetadata))

func (*HTTPInfo) Metadata

func (mw *HTTPInfo) Metadata() OpMetadata

type HTTPOption

type HTTPOption interface {
	SetHTTPOption(*HTTPInfo)
}

func Checksum

func Checksum(dgst digest.Digest) HTTPOption

func Chmod

func Chmod(perm os.FileMode) HTTPOption

func Chown

func Chown(uid, gid int) HTTPOption

func Filename

func Filename(name string) HTTPOption

type ImageInfo

type ImageInfo struct {
	// contains filtered or unexported fields
}

func (*ImageInfo) ApplyMetadata

func (mw *ImageInfo) ApplyMetadata(f func(m *OpMetadata))

func (*ImageInfo) Metadata

func (mw *ImageInfo) Metadata() OpMetadata

type ImageMetaResolver

type ImageMetaResolver interface {
	ResolveImageConfig(ctx context.Context, ref string) (digest.Digest, []byte, error)
}

type ImageOption

type ImageOption interface {
	SetImageOption(*ImageInfo)
}

func WithMetaResolver

func WithMetaResolver(mr ImageMetaResolver) ImageOption

type ImageOptionFunc

type ImageOptionFunc func(*ImageInfo)

func (ImageOptionFunc) SetImageOption

func (fn ImageOptionFunc) SetImageOption(ii *ImageInfo)

type KeyValue

type KeyValue struct {
	// contains filtered or unexported fields
}

type LocalInfo

type LocalInfo struct {
	SessionID       string
	IncludePatterns string
	ExcludePatterns string
	SharedKeyHint   string
	// contains filtered or unexported fields
}

func (*LocalInfo) ApplyMetadata

func (mw *LocalInfo) ApplyMetadata(f func(m *OpMetadata))

func (*LocalInfo) Metadata

func (mw *LocalInfo) Metadata() OpMetadata

type LocalOption

type LocalOption interface {
	SetLocalOption(*LocalInfo)
}

func ExcludePatterns

func ExcludePatterns(p []string) LocalOption

func IncludePatterns

func IncludePatterns(p []string) LocalOption

func SessionID

func SessionID(id string) LocalOption

func SharedKeyHint

func SharedKeyHint(h string) LocalOption

type Meta

type Meta struct {
	Args []string
	Env  EnvList
	Cwd  string
	User string
}

type MetadataOpt

type MetadataOpt interface {
	SetMetadataOption(*OpMetadata)
	RunOption
	LocalOption
	HTTPOption
	ImageOption
	GitOption
}

func WithDescription

func WithDescription(m map[string]string) MetadataOpt

func WithExportCache

func WithExportCache() MetadataOpt

WithExportCache forces results for this vertex to be exported with the cache

func WithoutDefaultExportCache

func WithoutDefaultExportCache() MetadataOpt

WithoutDefaultExportCache resets the cache export for the vertex to use the default defined by the build configuration.

func WithoutExportCache

func WithoutExportCache() MetadataOpt

WithoutExportCache sets results for this vertex to be not exported with the cache

type MountInfo

type MountInfo struct {
	Target string
	Source Output
	Opts   []MountOption
}

type MountOption

type MountOption func(*mount)

func AsPersistentCacheDir

func AsPersistentCacheDir(id string) MountOption

func SourcePath

func SourcePath(src string) MountOption

type OpMetadata

type OpMetadata = pb.OpMetadata

type Output

type Output interface {
	ToInput() (*pb.Input, error)
	Vertex() Vertex
}

type RunOption

type RunOption interface {
	SetRunOption(es *ExecInfo)
}

func AddEnv

func AddEnv(key, value string) RunOption

func AddEnvf

func AddEnvf(key, value string, v ...interface{}) RunOption

func AddMount

func AddMount(dest string, mountState State, opts ...MountOption) RunOption

func Args

func Args(a []string) RunOption

func Dir

func Dir(str string) RunOption

func Dirf

func Dirf(str string, v ...interface{}) RunOption

func ReadonlyRootFS

func ReadonlyRootFS() RunOption

func Reset

func Reset(s State) RunOption

func Shlex

func Shlex(str string) RunOption

func Shlexf

func Shlexf(str string, v ...interface{}) RunOption

func User

func User(str string) RunOption

func With

func With(so ...StateOption) RunOption

type SourceOp

type SourceOp struct {
	// contains filtered or unexported fields
}

func NewSource

func NewSource(id string, attrs map[string]string, md OpMetadata) *SourceOp

func (*SourceOp) Inputs

func (s *SourceOp) Inputs() []Output

func (*SourceOp) Marshal

func (s *SourceOp) Marshal() (digest.Digest, []byte, *OpMetadata, error)

func (*SourceOp) Output

func (s *SourceOp) Output() Output

func (*SourceOp) Validate

func (s *SourceOp) Validate() error

type State

type State struct {
	// contains filtered or unexported fields
}

func Git

func Git(remote, ref string, opts ...GitOption) State

func HTTP

func HTTP(url string, opts ...HTTPOption) State

func Image

func Image(ref string, opts ...ImageOption) State

func Local

func Local(name string, opts ...LocalOption) State

func NewState

func NewState(o Output) State

func Scratch

func Scratch() State

func Source

func Source(id string) State

func (State) AddEnv

func (s State) AddEnv(key, value string) State

func (State) AddEnvf

func (s State) AddEnvf(key, value string, v ...interface{}) State

func (State) Dir

func (s State) Dir(str string) State

func (State) Dirf

func (s State) Dirf(str string, v ...interface{}) State

func (State) GetArgs

func (s State) GetArgs() []string

func (State) GetDir

func (s State) GetDir() string

func (State) GetEnv

func (s State) GetEnv(key string) (string, bool)

func (State) Marshal

func (s State) Marshal(md ...MetadataOpt) (*Definition, error)

func (State) Output

func (s State) Output() Output

func (State) Reset

func (s State) Reset(s2 State) State

func (State) Run

func (s State) Run(ro ...RunOption) ExecState

func (State) User

func (s State) User(v string) State

func (State) Validate

func (s State) Validate() error

func (State) Value

func (s State) Value(k interface{}) interface{}

func (State) With

func (s State) With(so ...StateOption) State

func (State) WithOutput

func (s State) WithOutput(o Output) State

func (State) WithValue

func (s State) WithValue(k, v interface{}) State

type StateOption

type StateOption func(State) State

type Vertex

type Vertex interface {
	Validate() error
	Marshal() (digest.Digest, []byte, *OpMetadata, error)
	Output() Output
	Inputs() []Output
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL