GP
Size: a a a
GP
VM
GP
VM
GP
S
DP
VM
VM
S
GP
VS
IK
rpc Health(google.protobuf.Empty) returns (google.api.HttpBody) {
option (google.api.http) = {
get: "/api/v1/health"
};
}
protoc
должен сгенерировать http ендпонит. Но он почему то этого не делает.protoc
команжа для генерацииprotoc -I/usr/local/include -I. -I${GOPATH}/src \
-I=${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--go_out=plugins=grpc:. \
--go_opt=paths=source_relative server.proto
IK
func (s *server) Health(ctx context.Context, in *emptypb.Empty) (*httpbody.HttpBody, error) {
fmt.Println("call health")
return &httpbody.HttpBody{
Data: []byte("Ok"),
}, nil
}
p
p
VM
p