package sourcecache
import "golang.org/x/build/internal/sourcecache"
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 ¶
- func GetSourceTgz(sl spanlog.Logger, repo, rev string) (tgz io.Reader, err error)
- func RegisterGitMirrorDial(dial func(context.Context) (net.Conn, error))
- type TooBigError
Functions ¶
func GetSourceTgz ¶
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 ¶
RegisterGitMirrorDial registers a dial function which will be used to reach gitmirror. If used, this function must be called before GetSourceTgz.
Types ¶
type TooBigError ¶
TooBigError is the error returned when the source revision is considered too big.
func (TooBigError) Error ¶
func (e TooBigError) Error() string
Source Files ¶
source.go
- Version
- v0.0.0-20250421191922-3619c213cff3 (latest)
- Published
- Apr 21, 2025
- Platform
- linux/amd64
- Imports
- 12 packages
- Last checked
- 3 months ago –
Tools for package owners.