Documentation
¶
Index ¶
- Variables
- func ValidateRepositoryRef(value string) error
- type Checkout
- type Client
- func (c *Client) Capabilities() registry.SourceCaps
- func (c *Client) Checkout(ctx context.Context, slug, ref string) (_ *Checkout, err error)
- func (c *Client) Close() error
- func (c *Client) Download(ctx context.Context, slug string, opts registry.DownloadOpts) (_ *registry.DownloadResult, err error)
- func (c *Client) Info(_ context.Context, slug string) (*registry.Detail, error)
- func (c *Client) Name() string
- func (c *Client) Search(context.Context, string, registry.SearchOpts) ([]registry.Listing, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidRepositoryRef reports a repository URL outside the public HTTPS grammar. ErrInvalidRepositoryRef = errors.New("gitsrc: invalid repository URL") // ErrRepositoryDestinationBlocked reports a repository whose resolved addresses violate policy. ErrRepositoryDestinationBlocked = errors.New("gitsrc: repository destination blocked") // ErrRepositoryTooLarge reports that the checked-out repository exceeds the archive content budget. ErrRepositoryTooLarge = errors.New("gitsrc: repository exceeds max uncompressed size") // ErrRepositoryTooManyFiles reports that the checked-out repository exceeds the archive entry budget. ErrRepositoryTooManyFiles = errors.New("gitsrc: repository exceeds max file count") )
ErrGitUnavailable reports that the required git executable cannot be found.
var ErrGitVersionUnsupported = errors.New("gitsrc: Git 2.37 or newer is required")
ErrGitVersionUnsupported reports a Git binary too old to pin approved DNS answers.
Functions ¶
func ValidateRepositoryRef ¶
ValidateRepositoryRef enforces the public git-source repository grammar and literal-address policy.
Types ¶
type Checkout ¶
type Checkout struct {
Path string
Repository string
// Commit is the verified full revision of the materialized tree.
Commit string
// contains filtered or unexported fields
}
Checkout owns a temporary repository tree until Close releases it.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client downloads extension trees from public git repositories.
func (*Client) Capabilities ¶
func (c *Client) Capabilities() registry.SourceCaps
Capabilities reports that arbitrary git repositories are not searchable.
func (*Client) Checkout ¶
Checkout transfers an exact repository tree to the caller, who must close it after capturing the package.
func (*Client) Download ¶
func (c *Client) Download( ctx context.Context, slug string, opts registry.DownloadOpts, ) (_ *registry.DownloadResult, err error)
Download shallow-clones a repository and returns its working tree as a gzip archive.
type Option ¶
type Option func(*Client)
Option configures a git registry client.
func WithCheckoutTempDir ¶
WithCheckoutTempDir places owned checkouts under an operator-selected, quota-controlled directory.
func WithLookPath ¶
WithLookPath overrides executable discovery.
func WithTimeout ¶
WithTimeout overrides the clone timeout.