git

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0 Imports: 42 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package git implements the source.Fetcher for KindGitRepository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveLocal

func ResolveLocal(
	ctx context.Context,
	location *gitrepo.Location,
	repositories []*manifest.GitRepository,
	options LocalOptions,
) (map[manifest.NamedResource]*store.SourceArtifact, error)

ResolveLocal resolves authored refs from an admitted location's own repository. Only matching mutable HEAD inputs may expose working-tree edits; committed artifacts retain their own object storage and use LocalPath solely for ownership. On error, returned artifacts contain only warnings and no usable content.

Types

type Client

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

Client retains invocation policy for deferred baseline operations.

func NewClient

func NewClient(
	cfg ClientConfig,
) (*Client, error)

NewClient requires a caller-owned network, including for local transport overrides.

func (*Client) Fetch

func (c *Client) Fetch(ctx context.Context, st storage.Storer, remoteURL string, options *git.FetchOptions) error

Fetch keeps caller policy and upstream failures available to structural classification.

func (*Client) List

func (c *Client) List(ctx context.Context, remoteURL string) ([]*plumbing.Reference, error)

List keeps upstream failures available to structural baseline classification.

type ClientConfig

type ClientConfig struct {
	Transports Transports
	// Network MUST outlive every operation that uses this client.
	Network  *source.Network
	Material source.TransportMaterial
}

ClientConfig requires a Network that outlives every operation.

type Connection

type Connection interface {
	io.Closer
	Reader() io.Reader
	Writer() io.WriteCloser
}

Connection requires Writer().Close() to preserve unread output. The operation owns the connection.

type Fetcher

type Fetcher struct {
	Cache *sourcecache.Cache
	// Network MUST outlive acquisitions and their cache producers.
	Network       *source.Network
	GitTransports Transports

	// Depth bounds history for refs that do not require reachability validation.
	Depth int
	// RestrictSchemes permits only HTTPS and SSH for untrusted inputs.
	RestrictSchemes bool
	// contains filtered or unexported fields
}

Fetcher acquires immutable Git generations through the common cache owner.

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(
	ctx context.Context,
	repo *manifest.GitRepository,
	reads *store.ReadSet,
	policyValue *sourcecache.Policy,
) (source.PreparedFetch, error)

Fetch acquires content using one execution's captured credentials and declarations.

func (*Fetcher) FetchRemoteBase

func (f *Fetcher) FetchRemoteBase(
	ctx context.Context,
	requestValue *RemoteBaseRequest,
	policyValue *sourcecache.Policy,
) (*store.SourceArtifact, error)

FetchRemoteBase returns an immutable lazy view of the whole public repository. An error may retain warnings without usable content.

type LocalOptions

type LocalOptions struct {
	Revision string
	Work     manifest.WorkScope
}

LocalOptions carries the admitted revision and requesting operation's attribution.

type RemoteBaseRequest

type RemoteBaseRequest struct {
	Work       manifest.WorkScope
	URL        string
	Ref        string
	Timeout    time.Duration
	Submodules bool
}

RemoteBaseRequest carries a public base's effective repository and command policy.

type Transport

type Transport func(context.Context, TransportRequest) (Connection, error)

Transport callbacks MUST support concurrent calls and honor cancellation. Their resources MUST outlive the invocation, including lazy baseline reads. A custom connector owns connection security.

type TransportRequest

type TransportRequest struct {
	URL      *url.URL
	Command  string
	Protocol int
}

TransportRequest callbacks MUST NOT mutate URL after returning.

type Transports

type Transports map[string]Transport

Transports keys MUST be exact lowercase schemes. Missing keys use upstream transports. Route behavior MUST remain stable while reusing a cache.

Jump to

Keyboard shortcuts

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