package git

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

Index

Functions

func Supported

func Supported() error

Supported returns nil if the system supports Git source

Types

type GitIdentifier

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

	VerifySignature *GitSignatureVerifyOptions
}

func NewGitIdentifier

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

func (*GitIdentifier) Capture

func (id *GitIdentifier) Capture(c *provenance.Capture, pin string) error

func (GitIdentifier) Scheme

func (GitIdentifier) Scheme() string

type GitSignatureVerifyOptions

type GitSignatureVerifyOptions struct {
	PubKey            []byte
	RejectExpiredKeys bool
	RequireSignedTag  bool // signed tag must be present
	IgnoreSignedTag   bool // even if signed tag is present, verify signature on commit object
}

type Metadata

type Metadata struct {
	Ref            string
	Checksum       string
	CommitChecksum string

	CommitObject []byte
	TagObject    []byte
}

type MetadataOpts

type MetadataOpts struct {
	ReturnObject bool
}

type Opt

type Opt struct {
	CacheAccessor cache.Accessor
}

type Source

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

func NewSource

func NewSource(opt Opt) (*Source, error)

func (*Source) Identifier

func (gs *Source) Identifier(scheme, ref string, attrs map[string]string, platform *pb.Platform) (source.Identifier, error)

func (*Source) Resolve

func (*Source) ResolveMetadata

func (gs *Source) ResolveMetadata(ctx context.Context, id *GitIdentifier, sm *session.Manager, jobCtx solver.JobContext, opt MetadataOpts) (*Metadata, error)

func (*Source) Schemes

func (gs *Source) Schemes() []string

Source Files

identifier.go source.go source_linux.go

Version
v0.26.1
Published
Nov 17, 2025
Platform
linux/amd64
Imports
40 packages
Last checked
18 minutes ago

Tools for package owners.