Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.32 KB

README.md

File metadata and controls

44 lines (31 loc) · 1.32 KB

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