Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModulePath ¶ added in v0.0.12
Copied from cmd/go/internal/modfile/read.go
ModulePath returns the module path from the gomod file text. If it cannot find a module path, it returns an empty string. It is tolerant of unrelated problems in the go.mod file.
func Rewrite ¶
func Rewrite(mod coordinates.Module, b repository.Blob) (repository.Blob, error)
Rewrite the zip we downloaded from the upstream VCS into a zip file in the format required by the go/cmd tooling. Fundamentally the zip file the Go tooling requires re-namespacing the content under the directory path of the module.
Additionally, the go/cmd does the following - limits the size of upstream .zip file to 500 MiB - limits the size of upstream LICENSE to 16 MiB - limits the size of upstream go.mod file to 16MiB - - removes other modules living in the same repo -
The only complete "documentation" for the format of the new zip archive is in the go tool source code: go/src/cmd/go/internal/modfetch/coderepo.go
The zip may contain multiple modules, each with its own go.mod. We need to prune everything that isn't in our module.
Types ¶
type Client ¶
Client is used to download .zip files from an upstream origin (e.g. github.com).
func NewHTTPClient ¶
func NewHTTPClient(options HTTPOptions) Client