A brief description of a software architecture based on golang micro services.
The keynote was shown during the Golangit meetup @ Codemotion Rome 2015 event on March 27th 2015.
27. Microservice implementation: main
func main() {
// parse some command-line parameters
// such as service ID and environment
...
deployer, err := servers.NewRPCServer(
new(interfaces.JSONRPCInterface),
Identifier,
Environment,
)
if err != nil {
log.Fatal(err)
}
deployer.ServeJSON()
...
// wait until an exit command is given
}
28. Microservice implementation: jsonrpc interface
func (i *JSONRPCInterface) Enqueue(
r *http.Request,
args *EnqueueArgs,
reply *string,
) error {
result, err := core.Enqueue(*args)
if err != nil {
return err
}
*reply = result
return nil
}