This is a template for doing go-micro development using GitLab. It's based on the helloworld Go Micro template.
First thing to do is update main.go with your new project path:
- proto "gitlab.com/gitlab-org/project-templates/go-micro/proto"
+ proto "gitlab.com/$YOUR_NAMESPACE/$PROJECT_NAME/proto"Note that these are not actual environment variables, but values you should replace.
- main.go - is the main definition of the service, handler and client
- proto - contains the protobuf definition of the API
Install the following
go run main.go --server_address localhost:8080micro call --address localhost:8080 greeter Greeter.Hello '{"name": "John"}'
grpcurl -plaintext -d '{}' localhost:50051 RPRaisingService/GetCountries
grpcurl -plaintext -d '{}' localhost:50051 RPRaisingService/GetProductNames
grpcurl -plaintext -d '{}' localhost:50051 RPRaisingService/GetSimilarProjects
grpcurl -plaintext -d '{}' localhost:50051 RPRaisingService/GetScatterPlot
grpcurl -plaintext -d '{"country": "60", "productName": "Product A", "employee_num": 15}' localhost:50051 RPRaisingService.GenerateRP
Make sure you have installed protoc and protoc-gen-go as described in https://github.com/go-micro/generator.
Go to the directory am-rprasingv1.0 and then you can generate the go code using the following:
protoc --proto_path=./proto --go_out=paths=source_relative:./proto --go-grpc_out=paths=source_relative:./proto ./proto/rpraising.proto