Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Port string
)
View Source
var RootCmd = &cobra.Command{
Version: "1.0.0",
Use: "gomather",
Short: "Simple Go gRPC microservice that does math.",
}
View Source
var StartCmd = &cobra.Command{ Use: "start", Short: "Starts the server", Run: func(command *cobra.Command, args []string) { listener, err := net.Listen("tcp", Port) if err != nil { log.Fatal("Server could not listen", rz.Err(err)) } server := grpc.NewServer() reflection.Register(server) math.RegisterMathServer(server, &svc.Math{}) log.Info("Server started on port", rz.String("port", Port)) if err := server.Serve(listener); err != nil { log.Fatal("Server could not start", rz.Err(err)) } }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.