gitsrc

package
v0.3.0-beta.13 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")
)
View Source
var ErrGitUnavailable = errors.New("gitsrc: git executable unavailable")

ErrGitUnavailable reports that the required git executable cannot be found.

View Source
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

func ValidateRepositoryRef(value string) error

ValidateRepositoryRef enforces the public git-source repository grammar and literal-address policy.

Types

type Client

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

Client downloads extension trees from public git repositories.

func NewClient

func NewClient(opts ...Option) *Client

NewClient constructs a git registry source.

func (*Client) Capabilities

func (c *Client) Capabilities() registry.SourceCaps

Capabilities reports that arbitrary git repositories are not searchable.

func (*Client) Close

func (c *Client) Close() error

Close has no retained resources.

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.

func (*Client) Info

func (c *Client) Info(_ context.Context, slug string) (*registry.Detail, error)

Info projects repository metadata without making a network request.

func (*Client) Name

func (c *Client) Name() string

Name returns the registry source identifier.

func (*Client) Search

Search is not supported for arbitrary git repositories.

type Option

type Option func(*Client)

Option configures a git registry client.

func WithLookPath

func WithLookPath(lookPath func(string) (string, error)) Option

WithLookPath overrides executable discovery.

func WithRunner

func WithRunner(run commandRunner) Option

WithRunner overrides command execution.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout overrides the clone timeout.

Jump to

Keyboard shortcuts

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