v0.0.0-...-cf4ed81 Latest Latest

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

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


Go Reference

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



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



This section is empty.


This section is empty.


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 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

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.


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