Giter Club home page Giter Club logo

grpc-gateway-boilerplate's Introduction

Hello πŸ‘‹

I'm Johan, I've been doing open source since 2016, mostly in the Go ecosystem 🐻. I'm currently a maintainer πŸ‘¨β€πŸ”§ of:

  • The Go WebAssembly Port 🌐, allowing the use of Go in the browser and the backend.
  • The gRPC-Gateway πŸŒ‰, a HTTP/JSON <-> gRPC translation layer which is serving companies and open source projects such as etcd, Core OS, Cockroach DB, Chef and others.
  • Certify πŸ‘¨β€βš–οΈ, a Go in-process certificate manager that automatically issues and renews certificates for your application.

I'm also a contributor πŸ‘¨β€πŸ’» to:

  • The Go standard library, especially the WebAssembly port, where I ported the GopherJS net/http implementation to the standard library, allowing the use of net/http HTTP requests from inside WebAssembly applications.
  • gRPC-Go, the official gRPC library for Go.

I author blog posts πŸ“° on varying topics, mostly relating to Go and gRPC on my personal website.

I also frequently deliver technical talks πŸ—¨οΈ at conferences, including GopherCon San Diego πŸ‡ΊπŸ‡Έ, GopherCon UK πŸ‡¬πŸ‡§, dotGo πŸ‡«πŸ‡·, GopherCon EU πŸ‡ͺπŸ‡Ί, FOSDEM πŸ‡§πŸ‡ͺ and more. I've also featured on Go Time πŸŽ™οΈ on topics ranging from security πŸ›‘οΈ to PostgreSQL 🐘. My personal website contains all the recordings and slides of my presentations.

Lastly, I'm frequently helping πŸ‘¨β€πŸ« beginners and experienced users alike to solve problems with their code and setup on Gophers slack, in particular on the topics that I have specific expertise, such as gRPC, protobuf and security. I can be found in the Gophers Slack under the username jbrandhorst. Come say hi!

grpc-gateway-boilerplate's People

Contributors

abhishekvrshny avatar clavinjune avatar dmitris avatar insanitywholesale avatar johanbrandhorst avatar mfridman avatar stefanvanburen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grpc-gateway-boilerplate's Issues

updating to new buf manifest/config versions

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:

  • In each directory holding .proto files, put a simple buf.yaml with the deps key and then run buf mod update to create the lock file
  • If you're using v1, 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
  • At the root of the project, buf.work.yaml can be just
version: v1
directories:
  - proto
  • Again at the root of the project, 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)
  • Finally, run buf mod update at the root and then buf generate which shouldn't result in any issues

That'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.

Cannot use this repo as a GitHub repo template

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

Incompatibility with the new Go ProtoReflect API

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!

Cannot find module for path embed

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?

How to use w/ Java Server

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!

Can I also use grpc-web?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.