Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetModInfo ¶ added in v1.0.0
GetModInfo retrieves mod info from URL
func Middleware ¶
Middleware acts as go proxy with given router.
transportPrefix is a head part of URL path which refers to address of go proxy before the module info. For example,
if we serving go proxy at https://0.0.0.0:8081/goproxy/..., transportPrefix will be "/goproxy"
func PathEncoding ¶ added in v1.0.0
PathEncoding returns go module encoded path
Types ¶
type Module ¶ added in v1.0.0
type Module interface { // ModulePath returns the module path. ModulePath() string // Versions lists all known versions with the given prefix. // Pseudo-versions are not included. // Versions should be returned sorted in semver order // (implementations can use SortVersions). Versions(ctx context.Context, prefix string) (tags []string, err error) // Stat returns information about the revision rev. // A revision can be any identifier known to the underlying service: // commit hash, branch, tag, and so on. Stat(ctx context.Context, rev string) (*RevInfo, error) // GoMod returns the go.mod file for the given version. GoMod(ctx context.Context, version string) (data []byte, err error) // Zip returns file reader of ZIP file for the given version of the module Zip(ctx context.Context, version string) (file io.ReadCloser, err error) }
Module represents go module: some VSC (git, mercurial, svn, etc), Gitlab, another Go modules proxy, etc
type Plugin ¶ added in v1.0.0
type Plugin interface { Module(req *http.Request, prefix string) (Module, error) Leave(source Module) error Close() error String() string }
Plugin gives a way to get a source object for a request
type RevInfo ¶ added in v1.0.0
type RevInfo struct { Version string // version string Time string // commit time // These fields are used for Stat of arbitrary rev, // but they are not recorded when talking about module versions. Name string `json:"-"` // complete ID in underlying repository Short string `json:"-"` // shortened ID, for use in pseudo-version }
RevInfo describes a single revision of a module source
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
internal
|
|
base
Package base defines shared basic pieces of the go command, in particular logging and the Command structure.
|
Package base defines shared basic pieces of the go command, in particular logging and the Command structure. |
browser
Package browser provides utilities for interacting with users' browsers.
|
Package browser provides utilities for interacting with users' browsers. |
bug
Package bug implements the “go bug” command.
|
Package bug implements the “go bug” command. |
cache
Package cache implements a build artifact cache.
|
Package cache implements a build artifact cache. |
cfg
Package cfg holds configuration shared by multiple parts of the go command.
|
Package cfg holds configuration shared by multiple parts of the go command. |
clean
Package clean implements the “go clean” command.
|
Package clean implements the “go clean” command. |
cmdflag
Package cmdflag handles flag processing common to several go tools.
|
Package cmdflag handles flag processing common to several go tools. |
dirhash
Package dirhash defines hashes over directory trees.
|
Package dirhash defines hashes over directory trees. |
doc
Package doc implements the “go doc” command.
|
Package doc implements the “go doc” command. |
envcmd
Package envcmd implements the “go env” command.
|
Package envcmd implements the “go env” command. |
fix
Package fix implements the “go fix” command.
|
Package fix implements the “go fix” command. |
fmtcmd
Package fmtcmd implements the “go fmt” command.
|
Package fmtcmd implements the “go fmt” command. |
generate
Package generate implements the “go generate” command.
|
Package generate implements the “go generate” command. |
get
Package get implements the “go get” command.
|
Package get implements the “go get” command. |
help
Package help implements the “go help” command.
|
Package help implements the “go help” command. |
list
Package list implements the “go list” command.
|
Package list implements the “go list” command. |
load
Package load loads packages.
|
Package load loads packages. |
modcmd
Package modcmd implements the “go mod” command.
|
Package modcmd implements the “go mod” command. |
modfetch/codehost
Package codehost defines the interface implemented by a code hosting source, along with support code for use by implementations.
|
Package codehost defines the interface implemented by a code hosting source, along with support code for use by implementations. |
modget
Package modget implements the module-aware “go get” command.
|
Package modget implements the module-aware “go get” command. |
module
Package module defines the module.Version type along with support code.
|
Package module defines the module.Version type along with support code. |
mvs
Package mvs implements Minimal Version Selection.
|
Package mvs implements Minimal Version Selection. |
objabi
Originally, Go object files were Plan 9 object files, but no longer.
|
Originally, Go object files were Plan 9 object files, but no longer. |
par
Package par implements parallel execution helpers.
|
Package par implements parallel execution helpers. |
run
Package run implements the “go run” command.
|
Package run implements the “go run” command. |
semver
Package semver implements comparison of semantic version strings.
|
Package semver implements comparison of semantic version strings. |
singleflight
Package singleflight provides a duplicate function call suppression mechanism.
|
Package singleflight provides a duplicate function call suppression mechanism. |
str
Package str provides string manipulation utilities.
|
Package str provides string manipulation utilities. |
test2json
Package test2json implements conversion of test binary output to JSON.
|
Package test2json implements conversion of test binary output to JSON. |
testenv
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
|
Package testenv provides information about what functionality is available in different testing environments run by the Go team. |
tool
Package tool implements the “go tool” command.
|
Package tool implements the “go tool” command. |
txtar
Package txtar implements a trivial text-based file archive format.
|
Package txtar implements a trivial text-based file archive format. |
version
Package version implements the “go version” command.
|
Package version implements the “go version” command. |
vet
Package vet implements the “go vet” command.
|
Package vet implements the “go vet” command. |
web
Package web defines helper routines for accessing HTTP/HTTPS resources.
|
Package web defines helper routines for accessing HTTP/HTTPS resources. |
plugin
|
|
Click to show internal directories.
Click to hide internal directories.