pkgsite-live
A docker image of pkgsite to see local modules documentations with livereload
Content
Introducing pkgsite-local-live
pkgsite-local-live
is a docker image that maintains a pkgsite instance up with all go modules stored in the folder $GOPATH/src
of the container. A watcher looks at any change in the go files to know when to restart the pkgsite instance and back reload all open browser views.
Binding your local $GOPATH/src
you can use pkgsite-local-live
to query the documentation from the local projects stored in your personal workspace, at the same time you can view the changes that occur while you are working on them in real-time.
In the next diagram you can look the three main sequences that it's contained in pkgsite-local-live
.
The first sequence block shows how are executed the internal service. A server named Reloader Server provide a proxy to pkgsite sources at the same time handle the reload system event to implement a live-reload feature. A watcher process is charge of listen any change on workspace folder that can contains change on documentation pages.
The next sequence shows us the process involucred when a developer visit a documentation page with his browser.
The last sequence shows us the steps launched when a go file is modified, created or deleted.
Please, look at Contributing to pkgsite-local-live
to choose the way to collaborate with you feel better.
Use
Run
docker run -v $GOPATH/src:/go/src -p 8080:80 mauroalderete/pkgsite-local-live:latest
Ports
Exposes the port 80 to access to pkgsite instance with all modules loaded.
Volumes
pkgsite-local-live
searches the modules in /go/src
path. You must provide a source that will contains the go modules.
If the volume source doesn't have any go module, the pkgsite instance will end with an error and you cannot see anything through the port. This state will maintain this way to a 'go.mod' file will be found.
It is expected that the source volume contains many go modules, each one in its own folder.
./myvolume
|- project-1
|- go.mod
|- project-2
|- go.mod
...
|- project-n
|- go.mod
Examples
docker run -v $GOPATH/src:/go/src -p 8080:80 mauroalderete/pkgsite-local-live:latest
Configures a container to load in pkgsite instance all modules stored in the golang standard workspace. Binds the port 8080 to access to pkgsite website.
Upcomming Features
pkgsite-local-live
has all the potential to grow further. Here are some of the upcoming features planned (not in any order),
- ✔️ Filter modules to load. You will can filter the modules that you want to load by pkgsite instance using a yaml file configure.
- ✔️ Index. You will can enable a index in the home page to view all modules loaded and visit to speedly.
How to Set up pkgsite-local-live
for Development?
You set up pkgsite-local-live
locally with a few easy steps.
- Clone the repository
git clone https://github.com/mauroalderete/pkgsite-local-live
cd pkgsite-local-live
Test reloader service
got=go test -v ./... -coverprofile=coverage.out -covermode=count && go tool cover -html=coverage.out
Build image
docker build -t <username>/pkgsite-local-live:<tag> .
Contributing to pkgsite-local-live
Any kind of positive contribution is welcome! Please help us to grow by contributing to the project.
If you wish to contribute, you can work on any issue or create one on your own. After adding your code, please send us a Pull Request.
Please read CONTRIBUTING
for details on our CODE OF CONDUCT
, and the process for submitting pull requests to us.
Support
We all need support and motivation. pkgsite-local-live
is not an exception. Please give this project a start to encourage and show that you liked it.
If you found the app helpful, consider supporting us with a coffee.