Open aalhour opened 5 years ago
What did you run and have you tried playing around with your proto_path
Having any imports with put you in the customization section https://github.com/gogo/letmegrpc#customization
This is the command I ran:
letmegrpc --addr=localhost:50051 --port=8080 --proto_path=. todo_list.proto
I will give the customization section a look and get back to you with feedback.
Thanks!
Same error, letmegrpc
cannot read the google/protobuf
message types:
$ go run todo_list.letmegrpc.go
todo_list.letmegrpc.go:12:2: cannot find package "google/protobuf" in any of:
/usr/local/go/src/google/protobuf (from $GOROOT)
/go/src/google/protobuf (from $GOPATH)
Same error happens from within a Docker image:
Successfully built 8237e132b3a9
Successfully tagged todo_list_admin:latest
package todo_list.letmegrpc.proto: cannot find package "todo_list.letmegrpc.proto" in any of:
/usr/local/go/src/todo_list.letmegrpc.proto (from $GOROOT)
/go/src/todo_list.letmegrpc.proto (from $GOPATH)
Here's the Dockerfile:
FROM golang:1.13.4-alpine
MAINTAINER aalhour
RUN apk add --update --no-cache \
git \
gcc \
g++ \
make \
musl-dev \
build-base \
protobuf
# Install letmegrpc
WORKDIR $GOPATH
RUN mkdir -p ./src/github.com/gogo/letmegrpc
RUN git clone https://github.com/gogo/letmegrpc ./src/github.com/gogo/letmegrpc
RUN git clone https://github.com/gogo/protobuf ./src/github.com/gogo/protobuf
RUN go get github.com/gogo/pbparser
RUN go get google.golang.org/grpc
RUN go get golang.org/x/net/context
RUN cd ./src/github.com/gogo/protobuf && make install
RUN cd ./src/github.com/gogo/letmegrpc && make install
# Copy the TodoList Proto Schema document
COPY .protos/todo_list.proto .
RUN protoc -I=. --letmegrpc_out=. --gogo_out=. todo_list.proto
# Run the admin
EXPOSE 50052
ENTRYPOINT ["go", "run", "todo_list.letmegrpc.proto"]
I tried fixing the problem by copying the google/protobuf
directory into the /go/src/
package but it still doesn't work as I believe the letmegrpc
is not compiling the proto schema correctly:
...
... setup letmegrpc
...
RUN cp -Rp ./src/github.com/gogo/protobuf/protobuf/google ./src/google
RUN cp -Rp ./src/github.com/gogo/protobuf/protobuf/google ./google
# Copy the TodoList Proto Schema document
COPY .protos/todo_list.proto .
RUN protoc -I=. --letmegrpc_out=. --gogo_out=. todo_list.proto
# Run the admin
EXPOSE 50052
ENTRYPOINT ["letmegrpc", "--addr=localhost:50051", "--port=8080", "--proto_path=.", "todo_list.proto"]
letmegrpc --addr=localhost:50051 --port=8080 --proto_path=. todo_list.proto
2019/11/18 12:46:42 ../../todo_list.letmegrpc.go:12:2: no Go files in /go/src/google/protobuf
exit status 1
@awalterschulze - any update on your side regarding how to solve this?
I suspect you won't be able to use the letmegrpc
directly.
--letmegrpc_out=.
looks like the way to go
And then you will need to write a small main.go
And setup your proto-path correctly
That is if I remember correctly
Sorry it has been a while and we are still looking for a maintainer to take over this project.
I get the following error when I try to generate a GUI with letmegrpc:
Check the original proto schema below for more details about the message types.
Original Proto Document: