So, newbie to Go here, and I’m working on porting a small web service I wrote in Python to Go. The python version consisted of a single Flask app, with handlers for a REST API that indexed data in Elasticsearch, and a dashboard that provides system status and basic data/search views.
My first attempt in Go sort of replicated that model: one flat package (“main”) written with Gin and elastigo. The package consists of a half-dozen files, and implements the REST api and the dashboard handlers, along with some backend abstractions.
Now I’d like to separate the web service from the dashboard service so that I can work on scaling the rest API, but run the management dashboard by itself, and I’m not sure how to do it. Each binary will need it’s own “main” package, but I want all the code in one repository as there is code that should be shared. Any tips?