Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFS ¶
LoadFS creates a virtual filesystem that implements the Go module proxy protocol. It scans a directory of module source code and automatically generates all the necessary proxy files: /@v/list, /@v/{version}.mod, /@v/{version}.zip, and /@v/{version}.info.
The input directory structure should be: rootDir/
example.com/
module1/
@v/
v1.0.0/
go.mod
main.go
...
v1.1.0/
go.mod
main.go
...
The returned filesystem can be used with http.FileServer(http.FS(fsys)) to serve a module proxy over HTTP, or with os.CopyFS(dir, fsys) to write the proxy files to disk for use with file:// URLs.
Types ¶
Click to show internal directories.
Click to hide internal directories.