Skip to content

walterwanderley/xo-grpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xo-grpc

Create a gRPC (and HTTP/JSON provided by grpc-gateway reverse proxy) Server from the generated code by the xo project.

Requirements

  • Go 1.20 or superior
  • xo
  • buf
go install github.com/xo/xo@latest
go install github.com/bufbuild/buf/cmd/buf@latest

Installation

go install github.com/walterwanderley/xo-grpc@latest

Example

  1. Generate go code to access your database using xo. For more informations about xo command line parameters, please visit the xo Documentation
mkdir models
xo schema -o models [Database Connection URL] 
  1. Execute xo-grpc to generate the gRPC Server boilerplate code:
xo-grpc models
  1. Run the generated server:
go run . -db [Database Connection URL] -dev -grpcui
  1. Enjoy!

Similar Projects

About

Create a gRPC Server from Database

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages