Reviewed-on: #9 Co-authored-by: jolheiser <firstname.lastname@example.org> Co-committed-by: jolheiser <email@example.com>
|7 months ago|
|cmd||7 months ago|
|database||1 year ago|
|docker||1 year ago|
|go-gpm||7 months ago|
|router||7 months ago|
|.gitignore||2 years ago|
|.woodpecker.yml||7 months ago|
|DOCS.md||7 months ago|
|LICENSE||1 year ago|
|README.md||7 months ago|
|docs.go||7 months ago|
|go.mod||7 months ago|
|go.sum||7 months ago|
|main.go||7 months ago|
|tools.go||7 months ago|
Go Package Mapping
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.
add- Add a local package
remove- Remove a local package
list- List local packages
config- Change local configuration
get- Get a list of packages
gpm get zerolog survey bbolt cli chito get all the modules needed for gpm itself (assuming the map resolves to the same packages)
server- Start a gpm server
gpm will call out to a gpm server to find a package.
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.
Remember to set a
Put it behind your favorite reverse proxy, and it's ready to go!