package source

import "github.com/moby/buildkit/source"

Index

Constants

const (
	DockerImageScheme = "docker-image"
	GitScheme         = "git"
	LocalScheme       = "local"
	HTTPScheme        = "http"
	HTTPSScheme       = "https"
)

Types

type GitIdentifier

type GitIdentifier struct {
	Remote           string
	Ref              string
	Subdir           string
	KeepGitDir       bool
	AuthTokenSecret  string
	AuthHeaderSecret string
	MountSSHSock     string
	KnownSSHHosts    string
}

func NewGitIdentifier

func NewGitIdentifier(remoteURL string) (*GitIdentifier, error)

func (*GitIdentifier) ID

func (i *GitIdentifier) ID() string

type HTTPIdentifier

type HTTPIdentifier struct {
	TLS      bool
	URL      string
	Checksum digest.Digest
	Filename string
	Perm     int
	UID      int
	GID      int
}

func NewHTTPIdentifier

func NewHTTPIdentifier(str string, tls bool) (*HTTPIdentifier, error)

func (*HTTPIdentifier) ID

func (*HTTPIdentifier) ID() string

type Identifier

type Identifier interface {
	ID() string // until sources are in process this string comparison could be avoided
}

func FromLLB

func FromLLB(op *pb.Op_Source, platform *pb.Platform) (Identifier, error)

func FromString

func FromString(s string) (Identifier, error)

type ImageIdentifier

type ImageIdentifier struct {
	Reference   reference.Spec
	Platform    *specs.Platform
	ResolveMode ResolveMode
	RecordType  client.UsageRecordType
}

func NewImageIdentifier

func NewImageIdentifier(str string) (*ImageIdentifier, error)

func (*ImageIdentifier) ID

func (*ImageIdentifier) ID() string

type LocalIdentifier

type LocalIdentifier struct {
	Name            string
	SessionID       string
	IncludePatterns []string
	ExcludePatterns []string
	FollowPaths     []string
	SharedKeyHint   string
}

func NewLocalIdentifier

func NewLocalIdentifier(str string) (*LocalIdentifier, error)

func (*LocalIdentifier) ID

func (*LocalIdentifier) ID() string

type Manager

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

func NewManager

func NewManager() (*Manager, error)

func (*Manager) Register

func (sm *Manager) Register(src Source)

func (*Manager) Resolve

func (sm *Manager) Resolve(ctx context.Context, id Identifier, sessM *session.Manager, vtx solver.Vertex) (SourceInstance, error)

type ResolveMode

type ResolveMode int
const (
	ResolveModeDefault ResolveMode = iota
	ResolveModeForcePull
	ResolveModePreferLocal
)

func ParseImageResolveMode

func ParseImageResolveMode(v string) (ResolveMode, error)

func (ResolveMode) String

func (r ResolveMode) String() string

type Source

type Source interface {
	ID() string
	Resolve(ctx context.Context, id Identifier, sm *session.Manager, vtx solver.Vertex) (SourceInstance, error)
}

type SourceInstance

type SourceInstance interface {
	CacheKey(ctx context.Context, g session.Group, index int) (string, solver.CacheOpts, bool, error)
	Snapshot(ctx context.Context, g session.Group) (cache.ImmutableRef, error)
}

Source Files

gitidentifier.go identifier.go manager.go

Directories

PathSynopsis
source/containerimage
source/git
source/http
source/local
Version
v0.8.1
Published
Dec 15, 2020
Platform
js/wasm
Imports
16 packages
Last checked
12 hours ago

Tools for package owners.