Skip to content

cosmotek/grpc-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grpc-template

This repo is a simple template for using a handleful of tools to provide an API that is typed using Protobuf, and exposes a JSON/REST interface.

The protobuf code for this project is stored in api/proto/v1/api. The main files of interest for this project include:

  • main.go
  • api/proto/v1/api/* (the proto definitions)
  • api/buf.gen.yaml (the codegen config)

Requirements

Protobuf Tools:

  • Buf

Go Libraries:

go install \
    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
    google.golang.org/protobuf/cmd/protoc-gen-go \
    google.golang.org/grpc/cmd/protoc-gen-go-grpc

Misc:

  • Swagger (Optional)

Building & Running

# run codegen
go generate ./...

# run the project
go run main.go

Useful Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages