mp

module
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2019 License: BSD-3-Clause

README

modprox - The Go Module Proxy

modprox is a Go Module Proxy focused on the internal hosting use case

documentation @ modprox.org

Go Report Card Build Status GoDoc License

Project Management
  • Issues
  • for the registry, prefix issues with registry:
  • for the proxy, prefix issues with proxy:
  • for the library packages (pkg/), prefix issues with lib:
Setting up modprox in your environment

For setting up your own instances of the modprox components, check out the extensive documentation on modprox.org

Hacking on the Registry

The registry needs a persistent store, and for local development we have a docker image with PostgreSQL setup to automatically create tables and users. To make things super simple, in the hack/ directory there is a docker-compose file already configured to setup the basic containers needed for local developemnt. Simply run

$ docker-compose up

in the hack/ directory to get them going. Also in the hack/ directory is a script for connecting to the MySQL that is running in the docker container, for ease of poking around.

$ compose up
Recreating modprox-postgres ... 
Recreating modprox-postgres ... done
Attaching to modprox-postgres
modprox-postgres | 2018-09-11 02:19:14.322 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
modprox-postgres | 2018-09-11 02:19:14.322 UTC [1] LOG:  listening on IPv6 address "::", port 5432
modprox-postgres | 2018-09-11 02:19:14.339 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
modprox-postgres | 2018-09-11 02:19:14.370 UTC [22] LOG:  database system was shut down at 2018-09-11 02:19:12 UTC
modprox-postgres | 2018-09-11 02:19:14.381 UTC [1] LOG:  database system is ready to accept connections

Also in the hack/ directory are some sample configuration files. By default, the included run-dev.sh script will use the hack/configs/registry-local.postgres.json file, which works well with the included docker-compose.yaml file.

Hacking on the Proxy

The proxy component is more simple than the registry in that it does not connect to anything (other than the registry itself). It does however maintain its data-store of downloaded modules on disk, and by default it saves modules in the /tmp directory.

Directories

Path Synopsis
cmd
pkg
clients/registry/registrytest
Package registrytest contains autogenerated mocks.
Package registrytest contains autogenerated mocks.
clients/zips/zipstest
Package zipstest contains autogenerated mocks.
Package zipstest contains autogenerated mocks.
metrics/stats/statstest
Package statstest contains autogenerated mocks.
Package statstest contains autogenerated mocks.
since
Package since provides convenience functions for computing elapsed time.
Package since provides convenience functions for computing elapsed time.
upstream/upstreamtest
Package upstreamtest contains autogenerated mocks.
Package upstreamtest contains autogenerated mocks.
internal/modules/get/gettest
Package gettest contains autogenerated mocks.
Package gettest contains autogenerated mocks.
internal/modules/store/storetest
Package storetest contains autogenerated mocks.
Package storetest contains autogenerated mocks.
internal/problems/problemstest
Package problemstest contains autogenerated mocks.
Package problemstest contains autogenerated mocks.
internal/data/datatest
Package datatest contains autogenerated mocks.
Package datatest contains autogenerated mocks.
internal/proxies/proxiestest
Package proxiestest contains autogenerated mocks.
Package proxiestest contains autogenerated mocks.
internal/tools/finder/findertest
Package findertest contains autogenerated mocks.
Package findertest contains autogenerated mocks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL