source

package
v0.0.0-...-cd8449e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package source fetches a team's files from its GitHub repo as a tarball and extracts the requested subpath — the deterministic fetch behind `atl install`.

No git binary is required (decision doc item 9, script-only distribution): a single HTTPS GET of the ref tarball, gunzip + untar in-process. A standalone team uses subpath ""; a first-party team in the atl monorepo uses its teams/<name> subpath. Extraction strips the archive's top-level "<repo>-<ref>/" directory and is hardened against path traversal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(r io.Reader, subpath, dest string) error

Extract reads a gzipped tar from r, strips the archive's single top-level directory, keeps only entries under subpath, and writes them under dest (so subpath becomes dest's root). Hardened against path traversal.

func Fetch

func Fetch(repo, subpath, ref string) (dir string, err error)

Fetch downloads repo@ref, extracts subpath into a fresh temp directory, and returns that directory. The caller owns it and should remove it when done. subpath "" means the repo root.

func TarballURL

func TarballURL(repo, ref string) string

TarballURL is the GitHub archive URL for a repo at a ref (tag, branch, or SHA).

Types

This section is empty.

Jump to

Keyboard shortcuts

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