Skip to content

Template for a production-ready gRPC service written in Go with Postgres bindings

Notifications You must be signed in to change notification settings

clintrovert/go-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-playground

build workflow

Simple go server with Docker build file

Project structure follows goland-standards recommendations.

Pre-requisites

Generate modeling structs for gRPC contract

protoc --go_out=. --go_opt=paths=source_relative \  
    --go-grpc_out=. --go-grpc_opt=paths=source_relative \
    api/model/*.proto

Local Development

Requesting unary User endpoints -

Get User

grpcurl -H 'authorization: Bearer test' -d '{"id":"<test>"}' -plaintext localhost:9090 playground.UserService.GetUser

Create User

grpcurl -H 'authorization: Bearer test' -d '{"name":"test","email":"[email protected]","password":"helloworld"}' -plaintext localhost:9090 playground.UserService.CreateUser

Update User

grpcurl -H 'authorization: Bearer test' -d '{"id":"<test>","name":"updatedName","email":"[email protected]", "password":"updatedPassword"}' -plaintext localhost:9090 playground.UserService.UpdateUser

Delete User

grpcurl -H 'authorization: Bearer test' -d '{"user_id":"<test>"}' -plaintext localhost:9090 playground.UserService.DeleteUser

Starting Local Dependencies

docker compose --env-file local.env up

About

Template for a production-ready gRPC service written in Go with Postgres bindings

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published