]> Cypherpunks.ru repositories - prepro.git/blob - README
622ec91b110333ebeb650a28a59564098e4bec17ec8dd730fd06d5db5119a23f
[prepro.git] / README
1 prepro -- prepare GOPROXY and go-import friendly website
2
3 Go modules (https://go.dev/ref/mod), that are not located on hard-coded
4 well-known hosting platforms like GitHub, are discovered by go-get using
5 the go-import-protocol: it requests special URL, based on module's name,
6 to get HTML with <meta name="go-import"> tag. That tag will redirect
7 go-get further either to VCS, or to GOPROXY-capable URL.
8
9 If VCS is in use, then go-get will invoke external utilities to checkout
10 the code from VCS. After that, it will create ZIP-archive with the
11 snapshot of the code and store it locally in cache directory.
12
13 GOPROXY protocol can be treated just like a HTTP-transport to that cache
14 directory. Only several prepared static files per each module's version
15 is enough.
16
17 * VCS solution is usually quicker to setup, because development VCS
18   repositories are publicly available in most cases too
19 * VCS requires corresponding external tools to be installed. Hardly
20   either Fossil or GNU Bazaar are often installed on many systems
21 * VCS checkout requires more disk space: for the VCS itself and for the
22   cached module's archive
23 * VCS is slower to check and download in general, because it requires
24   several round-trips during the handshake between server and client
25 * GOPROXY is easier to scale on multiple hosts, because you have to
26   replicate only several static files
27
28 Another advantage of GOPROXY is actually the reason why "prepro" was
29 born: current go-get can not handle SHA256-driven Git repositories. It
30 git-init-s empty repository first and then tries to git-fetch it, that
31 won't work if git-init was not aware of SHA256-based format. GOPROXY
32 gives easy ability to make that module's repository publicly fetchable.