llb

package
v0.0.0-...-b35638e Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Readonly

func Readonly(m *mount)

func WithDefaultMetaResolver

func WithDefaultMetaResolver(ii *ImageInfo)

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
}

func ReadonlyRootFS

func ReadonlyRootFS(ei ExecInfo) ExecInfo

type ExecOp

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

func NewExecOp

func NewExecOp(root Output, meta Meta, readOnly bool) *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() ([]byte, *pb.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
}

type GitOption

type GitOption func(*GitInfo)

func KeepGitDir

func KeepGitDir() GitOption

type ImageInfo

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

type ImageMetaResolver

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

func DefaultImageMetaResolver

func DefaultImageMetaResolver() ImageMetaResolver

func NewImageMetaResolver

func NewImageMetaResolver() ImageMetaResolver

type ImageOption

type ImageOption func(*ImageInfo)

func WithMetaResolver

func WithMetaResolver(mr ImageMetaResolver) ImageOption

type KeyValue

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

type LocalInfo

type LocalInfo struct {
	SessionID       string
	IncludePatterns string
}

type LocalOption

type LocalOption func(*LocalInfo)

func IncludePatterns

func IncludePatterns(p []string) LocalOption

func SessionID

func SessionID(id string) LocalOption

type Meta

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

type MountInfo

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

type MountOption

type MountOption func(*mount)

func SourcePath

func SourcePath(src string) MountOption

type OpMetadata

type OpMetadata struct {
	pb.OpMetadata
}

type Output

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

type RunOption

type RunOption func(es ExecInfo) 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 Reset

func Reset(s State) RunOption

func Shlex

func Shlex(str string) RunOption

func Shlexf

func Shlexf(str string, v ...interface{}) 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) *SourceOp

func (*SourceOp) Inputs

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

func (*SourceOp) Marshal

func (s *SourceOp) Marshal() ([]byte, *pb.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 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() (*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) 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() ([]byte, *pb.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