Go Base Image with some common features

I want to have one go image with some common features like (http router, https with certificates handling, logging …etc) . This image will act as base image.

So now i want to have some thing plug-able code that can run with this base image.
The plug-able code should be compile separately and should use the base image http router, https certificates management, logging features etc.

By this way, any body can take the base image and he has to just register the http handler function to start a new micro service.(No need to bother about other common functionalities).

How can this be achieve ?

Perhaps you can use the plugin package

https://golang.org/pkg/plugin/

Though I’m not sure if that is a good design decision, I’d make the “base image” a framework that you can link to/import from/use through your “Microservices”.