johanbrandhorst / grpc-gateway-boilerplate Goto Github PK
View Code? Open in Web Editor NEWAll the boilerplate you need to get started with writing grpc-gateway powered REST services in Go
License: MIT License
All the boilerplate you need to get started with writing grpc-gateway powered REST services in Go
License: MIT License
Make CI not RIP, #43 (comment)
error issue
Can I run this without TLS?
Hi, when I run the command for a standalone server I get a transient failure message. I'm kind of confused how to incorporate my own server, I have the address/port that the server is running on but I don't see how to get the gateway to point to it. Any help would be great thanks!
Hi - great project! Unfortunately, I'm hitting a blocker when I try to get your project up and running:
$ go run main.go
go: finding golang.org/x/net v0.0.0-20191002035440-2ec189313ef0
# github.com/johanbrandhorst/grpc-gateway-boilerplate/proto
proto/example.pb.gw.go:45:2: cannot use msg (type *User) as type protoreflect.ProtoMessage in return argument:
*User does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
proto/example.pb.gw.go:62:2: cannot use msg (type *User) as type protoreflect.ProtoMessage in return argument:
*User does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
proto/example.pb.gw.go:192:104: cannot use *User value as type protoreflect.ProtoMessage in return argument:
*User does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
It seems like this may be an issue with the new Go API for Protocol Buffers? I'm not sure if this is a version incompatibility issue with the versions specified in go.mod
or if I'm perhaps using the wrong version of protoc
?
$ protoc --version
libprotoc 3.11.2
Any thoughts would be very much appreciated!
We cannot use this repo as a template as statik/statik.go has 13.7MB in this repo as of 2020-11-04, which was recently introduced in #17.
File size | before #17 (= after #14) | after #17 |
---|---|---|
statik/statik.go |
6.8MB | 13.7MB |
Anyone can reproduce this by starting with Use this template
button to see the following error:
We're sorry, something went wrong.
We were unable to clone johanbrandhorst/grpc-gateway-boilerplate's contents into{username,orgname}/{reponame}
. The template you used includes files that are larger than 10 megabytes. Please ask johanbrandhorst to remove those files from the template and try again.
cf. https://github.com/education/classroom/issues/2521
Can i listen both on https and http?
Hi, thank you for the project!
Is there a simplest way to handle streaming responses in Swagger web page (which is based on auto gen swagger .json)?
I'm trying to figure out how I would ALSO be able to open up a way for the mux to grab http 1.1 requests that are sendt via grpc-web.
It's not an issue, but I'm asking for some help, even for a good place to gather wisdom from.
See grpc-web:
grpcServer := grpc.Server()
wrappedGrpc := grpcweb.WrapServer(grpcServer)
tlsHttpServer.Handler = http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
if wrappedGrpc.IsGrpcWebRequest(req) {
wrappedGrpc.ServeHTTP(resp, req)
}
// Fall back to other servers.
http.DefaultServeMux.ServeHTTP(resp, req)
})
I'm going to be trying it soon, but I'm still working on some architecture, and now I realize this has to be possible but I don't know how yet.
buf does not provide pre-built darwin arm64 (mac m1) see bufbuild/buf#316
First off I'd like to thank you for your awesome work, this repository has been an incredibly valuable source for learning how to structure a gRPC project in Go that uses gRPC-gateway.
I started writing my own template last year to add a few more things that I wanted to be figured out when I want to write a new service and it can be found in this repository on gitlab (it's also mirrored here on github).
Currently, my buf.yaml
and buf.gen.yaml
look a lot like yours and there is also wouldbe-buf.work.yaml
because it currently doesn't work if you try to upgrade or if you just follow the steps in the official tour.
This led me to spend many evenings trying to troubleshoot it until I read a blog post that provided just enough details to figure out the issue.
In this commit on a feature branch I discovered that there is indeed a way to upgrade to it although it's less than ideal.
In rough order:
.proto
files, put a simple buf.yaml
with the deps
key and then run buf mod update
to create the lock filev1
, v2
and so on for different versions of the API, you need to do the above step seemingly for all directories until the repo root but I haven't done extensive testing. I had to do it in my protos/
directory that has two subdirectories/packages called v1
and v2
buf.work.yaml
can be justversion: v1
directories:
- proto
buf.yaml
doesn't need the build
key so it can just have the necessary name
, version
and deps
, of course with version
going from v1beta1
to v1
(v1 is where build
and consequently build.root
was removed)buf mod update
at the root and then buf generate
which shouldn't result in any issuesThat's what worked for me, I hope this helps somewhat in case you were holding back from upgrading due to the inability for buf to pull in .proto
dependencies or generate files properly.
Let me know if there is any additional information I can provide in case you wish to update the way buf
stuff is handled, otherwise feel free to close the issue, I just wanted to share my experience dealing with this problem and what I did to fix it.
Hi there, thanks for providing this boilerplate repo.
I've checked this repo out and followed the instructions, running make install
then make generate
.
When running go main.go run
the command errors out with this message:
build github.com/johanbrandhorst/grpc-gateway-boilerplate: cannot find module for path embed
Do you have any idea what could be happening here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.