sourcecache

package
v0.0.0-...-2f2bd00 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

README

Go Reference

golang.org/x/build/internal/sourcecache

Package sourcecache provides a cache of code found in Git repositories.

Documentation

Overview

Package sourcecache provides a cache of code found in Git repositories. It takes directly to the Gerrit instance at go.googlesource.com. If RegisterGitMirrorDial is called, it will first try to get code from gitmirror before falling back on Gerrit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSourceTgz

func GetSourceTgz(sl spanlog.Logger, repo, rev string) (tgz io.Reader, err error)

GetSourceTgz returns a Reader that provides a tgz of the requested source revision. repo is go.googlesource.com repo ("go", "net", and so on). rev is git revision.

An error of type TooBigError is returned if the compressed tarball exceeds a size that on 2021-11-22 was deemed to be enough to meet expected legitimate future needs for a while. See golang.org/issue/46379.

func RegisterGitMirrorDial

func RegisterGitMirrorDial(dial func(context.Context) (net.Conn, error))

RegisterGitMirrorDial registers a dial function which will be used to reach gitmirror. If used, this function must be called before GetSourceTgz.

Types

type TooBigError

type TooBigError struct {
	Repo  string
	Rev   string
	Limit int64 // Max size in bytes.
}

TooBigError is the error returned when the source revision is considered too big.

func (TooBigError) Error

func (e TooBigError) Error() string

Jump to

Keyboard shortcuts

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