Go Package Mapper
 
 
Go to file
jolheiser fd2e2d0be9
Massive changes
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2021-02-27 22:26:30 -06:00
cmd Massive changes 2021-02-27 22:26:30 -06:00
database Massive changes 2021-02-27 22:26:30 -06:00
docker Massive changes 2021-02-27 22:26:30 -06:00
go-gpm Massive changes 2021-02-27 22:26:30 -06:00
router Massive changes 2021-02-27 22:26:30 -06:00
.gitignore Initial commit 2020-02-18 23:18:36 -06:00
.golangci.yml Add CI config (#1) 2020-02-21 14:12:58 +00:00
Earthfile Massive changes 2021-02-27 22:26:30 -06:00
LICENSE Massive changes 2021-02-27 22:26:30 -06:00
Makefile Massive changes 2021-02-27 22:26:30 -06:00
README.md Massive changes 2021-02-27 22:26:30 -06:00
docs.go Massive changes 2021-02-27 22:26:30 -06:00
go.mod Massive changes 2021-02-27 22:26:30 -06:00
go.sum Massive changes 2021-02-27 22:26:30 -06:00
main.go Massive changes 2021-02-27 22:26:30 -06:00

README.md

GPM

Go Package Mapping

Motivation

I personally use a lot of nice libraries in Go, but every time I start a new project I have to go hunting for import paths again!

Enter GPM, a glorified mapping of simple names to go-get imports.

For example, I use urfave/cli for all of my CLI projects. I've used it enough times to remember the import path, but let's say I didn't.
Using either a GPM server or local config, I can instead gpm get cli which finds cli in my map and runs go get github.com/urfave/cli/v2.

Commands

  • add - Add a local package
  • remove - Remove a local package
  • list - List local packages
  • config - Change local configuration
  • export - Export local packages to JSON
  • import - Import JSON to local packages. Either give a path to a .json file, or a URL to a GPM server
    • e.g. https://gpm.jolheiser.com
  • get - Get a list of packages
    • e.g. gpm get beaver survey toml homedir cli chi to get all the modules needed for gpm itself (assuming the map resolves to the same packages)
  • server - Start a gpm server

Server

If GPM doesn't find a package locally, it can call out to a configurable gpm server to find a package there instead.
This makes it much simpler to have a central library of packages rather than exporting and importing between environments.

Want to run your own server? It's very easy! This CLI comes packaged with the server inside, simply run gpm server to start up a GPM server.
Put it behind your favorite reverse proxy and it's ready to go!

License

MIT