Skip to content

DNK90/grpc_gorm_sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  • Install
go install \
    github.com/golang/protobuf/protoc-gen-go \
    github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
    github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
    github.com/infobloxopen/protoc-gen-gorm

After install, protoc-gen-go protoc-gen-grpc-gateway protoc-gen-swagger and protoc-gen-gorm will be added into $GOPATH/bin

  • In order to generate sample.pb.go sample.pb.gorm.go and sample.pb.gw.go run the following script
protoc -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out=plugins=grpc:. --gorm_out=. --grpc-gateway_out=logtostderr=true:. -grpc-gateway_out=logtostderr=true:. sample/sample.proto sample/sample.proto
POST /v1/addItem
BODY
{
    "id": "123"
    "name": "item1"
    "description": "itemDescription"
}
  • Get Item By ID
POST /v1/getItem
BODY
{
    "id": "123"
}
  • List all items
POST /v1/listItems

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages