sagafetch

package
v0.125.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package sagafetch fetches Saga fragments held in other repositories.

It exists because pkg/saga cannot: fetching means git, git lives in internal/, and pkg/ does not import internal/. So pkg/saga declares the seam (saga.Fetcher) and this supplies something that can fill it, the same arrangement as sbom.Generator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

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

Fetcher materializes remote fragment references, reusing one checkout per repository and revision within a run.

Sharing matters more here than it looks. A monorepo's descriptor may name several fragments from one platform repository, and each is a `path:` into the same tree, cloning once and expanding every pattern against it is the difference between one clone and five.

func New

func New(ctx context.Context) *Fetcher

New returns a Fetcher that clones with git. Close releases every checkout it made.

func (*Fetcher) Close

func (f *Fetcher) Close()

Close removes the checkouts this Fetcher made.

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(url, revision string) (string, string, func(), error)

Fetch returns a directory holding url at revision, and the commit it resolved to.

Offline is refused rather than skipped. A fragment that cannot be fetched is scope the descriptor claims and the run would not have, and a scan that quietly covers less than its descriptor says is the failure this tool exists to prevent, so it is worth failing the run.

Jump to

Keyboard shortcuts

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