sources

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 13 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 sources fetches upstream artefacts into the pipeline's working directory and records where they landed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTarGz

func ExtractTarGz(archive, dest string) error

ExtractTarGz unpacks a gzipped tar, refusing any entry that escapes dest.

func ExtractZip

func ExtractZip(archive, dest string) error

ExtractZip unpacks a zip, refusing any entry that escapes dest.

Types

type Compound

type Compound struct {
	pipeline.SourceKind
	First, Second pipeline.Source
}

Compound runs two sources in order.

A pipeline takes exactly one source, and the emoji recipe needs both an asset fetch and the CLDR taxonomy. The taxonomy runs first so the asset source owns fetched_path -- reverse them and the categoriser is handed the taxonomy file as its tree.

func (Compound) Execute

func (c Compound) Execute(ctx *pipeline.Context) error

func (Compound) Name

func (c Compound) Name() string

type Downloader

type Downloader interface {
	Download(ctx context.Context, url, dest string, force bool) (string, error)
}

Downloader is the HTTP surface the sources need.

type GithubArchive

type GithubArchive struct {
	pipeline.SourceKind

	// ArchiveURL is a template with {version}. When empty it is built from
	// Owner, Repo and Version -- note the built form hardcodes a `v` prefix,
	// which is why a project tagging without one has to supply the template.
	ArchiveURL string
	Owner      string
	Repo       string
	Version    string

	HTTP Downloader
	Log  *slog.Logger
}

GithubArchive downloads a tagged archive and extracts it.

func (GithubArchive) Execute

func (s GithubArchive) Execute(ctx *pipeline.Context) error

func (GithubArchive) Name

func (GithubArchive) Name() string

type NpmTarball

type NpmTarball struct {
	pipeline.SourceKind

	Package string
	Version string
	Log     *slog.Logger
}

NpmTarball fetches a package with `npm pack` and extracts it.

Shells out to npm rather than resolving the registry directly: npm handles scoped names, auth and the tarball URL indirection, and the image already ships it.

func (NpmTarball) Execute

func (s NpmTarball) Execute(ctx *pipeline.Context) error

func (NpmTarball) Name

func (NpmTarball) Name() string

type Static

type Static struct {
	pipeline.SourceKind
	Version string
}

Static satisfies the pipeline's "must have a source" rule for a commit-only pipeline, which has nothing to fetch but still has a version to record.

It replaces Python's _NoOpSource, and the difference is a bug fix rather than a rename. Each pipeline gets its own context, so nothing the emoji recipe's three asset pipelines set reaches its trailing commit pipeline. With a source that set nothing, VersionStamp found no fetched_version, logged "skipping" and did nothing -- so icon-sets-emoji was never stamped at all, and its sync could not converge. That is precisely the V49 failure the vendored-version design exists to prevent, still live in the one recipe that composes several pipelines.

func (Static) Execute

func (s Static) Execute(ctx *pipeline.Context) error

func (Static) Name

func (Static) Name() string

type UnicodeCldr

type UnicodeCldr struct {
	pipeline.SourceKind

	// UnicodeVersion is the emoji release, e.g. "16.0".
	//
	// The default has bitten this project: it ran ahead of what Unicode had
	// published, every fetch 404'd, and the pack shipped a tagged release with
	// zero SVGs. Set it to a version that exists.
	UnicodeVersion string

	HTTP Downloader
	Log  *slog.Logger
}

UnicodeCldr downloads the emoji taxonomy the categoriser needs.

func (UnicodeCldr) Execute

func (s UnicodeCldr) Execute(ctx *pipeline.Context) error

func (UnicodeCldr) Name

func (UnicodeCldr) Name() string

Jump to

Keyboard shortcuts

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