Skip to content

Instantly share code, notes, and snippets.

@jmrobles
Created December 8, 2020 16:04
Show Gist options
  • Save jmrobles/bc56a4919909a2037bfeb32b9cba9381 to your computer and use it in GitHub Desktop.
Save jmrobles/bc56a4919909a2037bfeb32b9cba9381 to your computer and use it in GitHub Desktop.
package main
import (
"helloworld/handler"
pb "helloworld/proto"
"github.com/micro/micro/v3/service"
"github.com/micro/micro/v3/service/logger"
)
func main() {
// Create service
srv := service.New(
service.Name("helloworld"),
service.Version("latest"),
)
// Register handler
pb.RegisterHelloworldHandler(srv.Server(), new(handler.Helloworld))
// Run service
if err := srv.Run(); err != nil {
logger.Fatal(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment