fetch

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fetch provides utilities for fetching GitHub repository metadata and computing checksums.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LatestSha

func LatestSha(query string) (string, error)

LatestSha fetches the latest commit SHA from the GitHub API for the given repository URL.

func Sha256

func Sha256(query string) (string, error)

Sha256 downloads the content from the given URL and returns its SHA256 checksum as a hex string.

func TarballLink(githubDownload string, repo *Repo, sha string) string

TarballLink constructs a GitHub tarball download URL for the given repository and commit SHA.

Types

type Endpoints

type Endpoints struct {
	// API defines the endpoint used to make API calls.
	API string

	// Download defines the endpoint to download tarballs.
	Download string
}

Endpoints defines the endpoints used to access GitHub.

type Repo

type Repo struct {
	// Org defines the GitHub organization (or user), that owns the repository.
	Org string

	// Repo is the name of the repository, such as `googleapis` or `google-cloud-rust`.
	Repo string
}

Repo represents a GitHub repository name.

func RepoFromTarballLink(githubDownload, tarballLink string) (*Repo, error)

RepoFromTarballLink extracts the gitHub account and repository (such as `googleapis/googleapis`, or `googleapis/google-cloud-rust`) from the tarball link.

Jump to

Keyboard shortcuts

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