Versions in this module Expand all Collapse all v1 v1.1.10 Dec 12, 2023 Changes in this version + const NetModeHost + const NetModeNone + const NetModeSandbox + const SecurityModeInsecure + const SecurityModeSandbox + var Darwin = Platform(ocispecs.Platform{ ... }) + var IgnoreCache = constraintsOptFunc(func(c *Constraints) { ... }) + var LinuxAmd64 = Platform(ocispecs.Platform{ ... }) + var LinuxArm = LinuxArmhf + var LinuxArm64 = Platform(ocispecs.Platform{ ... }) + var LinuxArmel = Platform(ocispecs.Platform{ ... }) + var LinuxArmhf = Platform(ocispecs.Platform{ ... }) + var LinuxPpc64 = Platform(ocispecs.Platform{ ... }) + var LinuxPpc64le = Platform(ocispecs.Platform{ ... }) + var LinuxS390x = Platform(ocispecs.Platform{ ... }) + var MarkImageInternal = imageOptionFunc(func(ii *ImageInfo) { ... }) + var SSHOptional = sshOptionFunc(func(si *SSHInfo) { ... }) + var SecretOptional = secretOptionFunc(func(si *SecretInfo) { ... }) + var Windows = Platform(ocispecs.Platform{ ... }) + func ForceNoOutput(m *mount) + func MarshalConstraints(base, override *Constraints) (*pb.Op, *pb.OpMetadata) + func Readonly(m *mount) + func WriteTo(def *Definition, w io.Writer) error + type CacheMountSharingMode int + const CacheMountLocked + const CacheMountPrivate + const CacheMountShared + type ChownOpt struct + Group *UserOpt + User *UserOpt + func (co ChownOpt) SetCopyOption(mi *CopyInfo) + func (co ChownOpt) SetMkdirOption(mi *MkdirInfo) + func (co ChownOpt) SetMkfileOption(mi *MkfileInfo) + type ChownOption interface + func WithUIDGID(uid, gid int) ChownOption + func WithUser(name string) ChownOption + type Constraints struct + Caps *apicaps.CapSet + LocalUniqueID string + Metadata pb.OpMetadata + Platform *ocispecs.Platform + SourceLocations []*SourceLocation + WorkerConstraints []string + func NewConstraints(co ...ConstraintsOpt) *Constraints + type ConstraintsOpt interface + SetConstraintsOption func(*Constraints) + func LocalUniqueID(v string) ConstraintsOpt + func Platform(p ocispecs.Platform) ConstraintsOpt + func ProgressGroup(id, name string, weak bool) ConstraintsOpt + func Require(filters ...string) ConstraintsOpt + func WithCaps(caps apicaps.CapSet) ConstraintsOpt + func WithCustomName(name string) ConstraintsOpt + func WithCustomNamef(name string, a ...interface{}) ConstraintsOpt + func WithDescription(m map[string]string) ConstraintsOpt + func WithExportCache() ConstraintsOpt + func WithoutDefaultExportCache() ConstraintsOpt + func WithoutExportCache() ConstraintsOpt + type CopyInfo struct + AllowEmptyWildcard bool + AllowWildcard bool + AttemptUnpack bool + ChownOpt *ChownOpt + CopyDirContentsOnly bool + CreateDestPath bool + CreatedTime *time.Time + ExcludePatterns []string + FollowSymlinks bool + IncludePatterns []string + Mode *os.FileMode + func (mi *CopyInfo) SetCopyOption(mi2 *CopyInfo) + type CopyInput interface + type CopyOption interface + SetCopyOption func(*CopyInfo) + type CreatedTime time.Time + func WithCreatedTime(t time.Time) CreatedTime + func (c CreatedTime) SetCopyOption(mi *CopyInfo) + func (c CreatedTime) SetMkdirOption(mi *MkdirInfo) + func (c CreatedTime) SetMkfileOption(mi *MkfileInfo) + type Definition struct + Constraints *Constraints + Def [][]byte + Metadata map[digest.Digest]pb.OpMetadata + Source *pb.Source + func ReadFrom(r io.Reader) (*Definition, error) + func (def *Definition) FromPB(x *pb.Definition) + func (def *Definition) Head() (digest.Digest, error) + func (def *Definition) ToPB() *pb.Definition + type DefinitionOp struct + func NewDefinitionOp(def *pb.Definition) (*DefinitionOp, error) + func (d *DefinitionOp) Inputs() []Output + func (d *DefinitionOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error) + func (d *DefinitionOp) Output() Output + func (d *DefinitionOp) ToInput(ctx context.Context, c *Constraints) (*pb.Input, error) + func (d *DefinitionOp) Validate(context.Context, *Constraints) error + func (d *DefinitionOp) Vertex(context.Context, *Constraints) Vertex + type DiffOp struct + func NewDiff(lower, upper State, c Constraints) *DiffOp + func (m *DiffOp) Inputs() (out []Output) + func (m *DiffOp) Marshal(ctx context.Context, constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error) + func (m *DiffOp) Output() Output + func (m *DiffOp) Validate(ctx context.Context, constraints *Constraints) error + type DiffType string + const DiffMetadata + const DiffNone + type DifferInfo struct + Required bool + Type DiffType + type EnvList []KeyValue + func (e EnvList) AddOrReplace(k, v string) EnvList + func (e EnvList) Delete(k string) EnvList + func (e EnvList) Get(k string) (string, bool) + func (e EnvList) Index(k string) (int, bool) + func (e EnvList) SetDefault(k, v string) EnvList + func (e EnvList) ToArray() []string + type ExecInfo struct + Mounts []MountInfo + ProxyEnv *ProxyEnv + ReadonlyRootFS bool + SSH []SSHInfo + Secrets []SecretInfo + State State + type ExecOp struct + func NewExecOp(base State, proxyEnv *ProxyEnv, readOnly bool, c Constraints) *ExecOp + func (e *ExecOp) AddMount(target string, source Output, opt ...MountOption) Output + func (e *ExecOp) GetMount(target string) Output + func (e *ExecOp) Inputs() (inputs []Output) + func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error) + func (e *ExecOp) Output() Output + func (e *ExecOp) Validate(ctx context.Context, c *Constraints) error + type ExecState struct + func (e ExecState) AddMount(target string, source State, opt ...MountOption) State + func (e ExecState) GetMount(target string) State + func (e ExecState) Root() State + type FileAction struct + func Copy(input CopyInput, src, dest string, opts ...CopyOption) *FileAction + func Mkdir(p string, m os.FileMode, opt ...MkdirOption) *FileAction + func Mkfile(p string, m os.FileMode, dt []byte, opts ...MkfileOption) *FileAction + func Rm(p string, opts ...RmOption) *FileAction + func (fa *FileAction) Copy(input CopyInput, src, dest string, opt ...CopyOption) *FileAction + func (fa *FileAction) Mkdir(p string, m os.FileMode, opt ...MkdirOption) *FileAction + func (fa *FileAction) Mkfile(p string, m os.FileMode, dt []byte, opt ...MkfileOption) *FileAction + func (fa *FileAction) Rm(p string, opt ...RmOption) *FileAction + func (fa *FileAction) WithState(s State) CopyInput + type FileOp struct + func NewFileOp(s State, action *FileAction, c Constraints) *FileOp + func (f *FileOp) Inputs() (inputs []Output) + func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error) + func (f *FileOp) Output() Output + func (f *FileOp) Validate(context.Context, *Constraints) error + type GitInfo struct + AuthHeaderSecret string + AuthTokenSecret string + KeepGitDir bool + KnownSSHHosts string + MountSSHSock string + type GitOption interface + SetGitOption func(*GitInfo) + func AuthHeaderSecret(v string) GitOption + func AuthTokenSecret(v string) GitOption + func KeepGitDir() GitOption + func KnownSSHHosts(key string) GitOption + func MountSSHSock(sshID string) GitOption + type HTTPInfo struct + Checksum digest.Digest + Filename string + GID int + Perm int + UID int + type HTTPOption interface + SetHTTPOption func(*HTTPInfo) + func Checksum(dgst digest.Digest) HTTPOption + func Chmod(perm os.FileMode) HTTPOption + func Chown(uid, gid int) HTTPOption + func Filename(name string) HTTPOption + type HostIP struct + Host string + IP net.IP + type ImageInfo struct + RecordType string + type ImageMetaResolver interface + ResolveImageConfig func(ctx context.Context, ref string, opt ResolveImageConfigOpt) (string, digest.Digest, []byte, error) + type ImageOption interface + SetImageOption func(*ImageInfo) + func ResolveDigest(v bool) ImageOption + func WithLayerLimit(l int) ImageOption + func WithMetaResolver(mr ImageMetaResolver) ImageOption + type KeyValue struct + type LocalInfo struct + Differ DifferInfo + ExcludePatterns string + FollowPaths string + IncludePatterns string + SessionID string + SharedKeyHint string + type LocalOption interface + SetLocalOption func(*LocalInfo) + func Differ(t DiffType, required bool) LocalOption + func ExcludePatterns(p []string) LocalOption + func FollowPaths(p []string) LocalOption + func IncludePatterns(p []string) LocalOption + func SessionID(id string) LocalOption + func SharedKeyHint(h string) LocalOption + type MarshalCache struct + func (mc *MarshalCache) Cached(c *Constraints) bool + func (mc *MarshalCache) Load() (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error) + func (mc *MarshalCache) Store(dt []byte, md *pb.OpMetadata, srcs []*SourceLocation, c *Constraints) + type MergeOp struct + func NewMerge(inputs []State, c Constraints) *MergeOp + func (m *MergeOp) Inputs() []Output + func (m *MergeOp) Marshal(ctx context.Context, constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error) + func (m *MergeOp) Output() Output + func (m *MergeOp) Validate(ctx context.Context, constraints *Constraints) error + type MkdirInfo struct + ChownOpt *ChownOpt + CreatedTime *time.Time + MakeParents bool + func (mi *MkdirInfo) SetMkdirOption(mi2 *MkdirInfo) + type MkdirOption interface + SetMkdirOption func(*MkdirInfo) + func WithParents(b bool) MkdirOption + type MkfileInfo struct + ChownOpt *ChownOpt + CreatedTime *time.Time + func (mi *MkfileInfo) SetMkfileOption(mi2 *MkfileInfo) + type MkfileOption interface + SetMkfileOption func(*MkfileInfo) + type MountInfo struct + Opts []MountOption + Source Output + Target string + type MountOption func(*mount) + func AsPersistentCacheDir(id string, sharing CacheMountSharingMode) MountOption + func SourcePath(src string) MountOption + func Tmpfs(opts ...TmpfsOption) MountOption + type OCILayoutInfo struct + type OCILayoutOption interface + SetOCILayoutOption func(*OCILayoutInfo) + func OCILayerLimit(limit int) OCILayoutOption + func OCIStore(sessionID string, storeID string) OCILayoutOption + type Output interface + ToInput func(context.Context, *Constraints) (*pb.Input, error) + Vertex func(context.Context, *Constraints) Vertex + type ProxyEnv struct + AllProxy string + FTPProxy string + HTTPProxy string + HTTPSProxy string + NoProxy string + type ResolveImageConfigOpt struct + LogName string + Platform *ocispecs.Platform + ResolveMode string + SourcePolicies []*spb.Policy + Store ResolveImageConfigOptStore + type ResolveImageConfigOptStore struct + SessionID string + StoreID string + type ResolveMode int + const ResolveModeDefault + const ResolveModeForcePull + const ResolveModePreferLocal + func (r ResolveMode) SetImageOption(ii *ImageInfo) + func (r ResolveMode) String() string + type ResolverType int + const ResolverTypeOCILayout + const ResolverTypeRegistry + type RmInfo struct + AllowNotFound bool + AllowWildcard bool + func (mi *RmInfo) SetRmOption(mi2 *RmInfo) + type RmOption interface + SetRmOption func(*RmInfo) + func WithAllowNotFound(b bool) RmOption + func WithAllowWildcard(b bool) RmOption + type RunOption interface + SetRunOption func(es *ExecInfo) + func AddExtraHost(host string, ip net.IP) RunOption + func AddMount(dest string, mountState State, opts ...MountOption) RunOption + func AddSSHSocket(opts ...SSHOption) RunOption + func AddSecret(dest string, opts ...SecretOption) RunOption + func AddUlimit(name UlimitName, soft int64, hard int64) RunOption + func Args(a []string) RunOption + func ReadonlyRootFS() RunOption + func Shlex(str string) RunOption + func Shlexf(str string, v ...interface{}) RunOption + func With(so ...StateOption) RunOption + func WithCgroupParent(cp string) RunOption + func WithProxy(ps ProxyEnv) RunOption + type SSHInfo struct + GID int + ID string + Mode int + Optional bool + Target string + UID int + type SSHOption interface + SetSSHOption func(*SSHInfo) + func SSHID(id string) SSHOption + func SSHSocketOpt(target string, uid, gid, mode int) SSHOption + func SSHSocketTarget(target string) SSHOption + type SecretInfo struct + GID int + ID string + IsEnv bool + Mode int + Optional bool + Target string + UID int + type SecretOption interface + SetSecretOption func(*SecretInfo) + func SecretAsEnv(v bool) SecretOption + func SecretFileOpt(uid, gid, mode int) SecretOption + func SecretID(id string) SecretOption + type SourceLocation struct + Ranges []*pb.Range + SourceMap *SourceMap + type SourceMap struct + Data []byte + Definition *Definition + Filename string + Language string + State *State + func NewSourceMap(st *State, filename string, lang string, dt []byte) *SourceMap + func (s *SourceMap) Location(r []*pb.Range) ConstraintsOpt + type SourceOp struct + func NewSource(id string, attrs map[string]string, c Constraints) *SourceOp + func (s *SourceOp) Inputs() []Output + func (s *SourceOp) Marshal(ctx context.Context, constraints *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error) + func (s *SourceOp) Output() Output + func (s *SourceOp) Validate(ctx context.Context, c *Constraints) error + type State struct + func Diff(lower, upper State, opts ...ConstraintsOpt) State + func Git(url, ref string, opts ...GitOption) State + func HTTP(url string, opts ...HTTPOption) State + func Image(ref string, opts ...ImageOption) State + func Local(name string, opts ...LocalOption) State + func Merge(inputs []State, opts ...ConstraintsOpt) State + func NewState(o Output) State + func OCILayout(ref string, opts ...OCILayoutOption) State + func Scratch() State + func (s State) AddEnv(key, value string) State + func (s State) AddEnvf(key, value string, v ...interface{}) State + func (s State) AddExtraHost(host string, ip net.IP) State + func (s State) AddUlimit(name UlimitName, soft int64, hard int64) State + func (s State) Async(f func(context.Context, State, *Constraints) (State, error)) State + func (s State) Dir(str string) State + func (s State) Dirf(str string, v ...interface{}) State + func (s State) Env(ctx context.Context, co ...ConstraintsOpt) ([]string, error) + func (s State) File(a *FileAction, opts ...ConstraintsOpt) State + func (s State) GetArgs(ctx context.Context, co ...ConstraintsOpt) ([]string, error) + func (s State) GetDir(ctx context.Context, co ...ConstraintsOpt) (string, error) + func (s State) GetEnv(ctx context.Context, key string, co ...ConstraintsOpt) (string, bool, error) + func (s State) GetHostname(ctx context.Context, co ...ConstraintsOpt) (string, error) + func (s State) GetNetwork(ctx context.Context, co ...ConstraintsOpt) (pb.NetMode, error) + func (s State) GetPlatform(ctx context.Context, co ...ConstraintsOpt) (*ocispecs.Platform, error) + func (s State) GetSecurity(ctx context.Context, co ...ConstraintsOpt) (pb.SecurityMode, error) + func (s State) Hostname(v string) State + func (s State) Marshal(ctx context.Context, co ...ConstraintsOpt) (*Definition, error) + func (s State) Network(n pb.NetMode) State + func (s State) Output() Output + func (s State) Platform(p ocispecs.Platform) State + func (s State) Reset(s2 State) State + func (s State) Run(ro ...RunOption) ExecState + func (s State) Security(n pb.SecurityMode) State + func (s State) SetMarshalDefaults(co ...ConstraintsOpt) State + func (s State) User(v string) State + func (s State) Validate(ctx context.Context, c *Constraints) error + func (s State) Value(ctx context.Context, k interface{}, co ...ConstraintsOpt) (interface{}, error) + func (s State) With(so ...StateOption) State + func (s State) WithCgroupParent(cp string) State + func (s State) WithImageConfig(c []byte) (State, error) + func (s State) WithOutput(o Output) State + func (s State) WithValue(k, v interface{}) State + type StateOption func(State) State + func AddEnv(key, value string) StateOption + func AddEnvf(key, value string, v ...interface{}) StateOption + func Dir(str string) StateOption + func Dirf(str string, v ...interface{}) StateOption + func Hostname(str string) StateOption + func Network(v pb.NetMode) StateOption + func Reset(other State) StateOption + func Security(v pb.SecurityMode) StateOption + func User(str string) StateOption + func (fn StateOption) SetRunOption(ei *ExecInfo) + type TmpfsInfo struct + Size int64 + type TmpfsOption interface + SetTmpfsOption func(*TmpfsInfo) + func TmpfsSize(b int64) TmpfsOption + type UlimitName string + const UlimitCPU + const UlimitCore + const UlimitData + const UlimitFsize + const UlimitLocks + const UlimitMemlock + const UlimitMsgqueue + const UlimitNice + const UlimitNofile + const UlimitNproc + const UlimitRss + const UlimitRtprio + const UlimitRttime + const UlimitSigpending + const UlimitStack + type UserOpt struct + Name string + UID int + type Vertex interface + Inputs func() []Output + Marshal func(context.Context, *Constraints) (digest.Digest, []byte, *pb.OpMetadata, []*SourceLocation, error) + Output func() Output + Validate func(context.Context, *Constraints) error