Skip to content

gafful/toohbos-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

toohbos-go

A toolbox of common go components.

Install modules: $ go mod init

Modules

REST Protobuf

REST API with Protobuf requests and responses

  • Client:
  • /: Sends JSON payload via POST request, converts payload to Protobuf and sends to Server.
  • Server receives the Protobuf payload, and sends it back in the response.
  • Server:
  • /: POST requests receives a Protobuf payload and sends it back encoded in Protobuf.
  • /: GET request returns a DummyResponse object over Protobuf.
  • /page: Both GET and POST requests return a paged response ProtoResponsePage
  • Add "?json=true" to get a JSON response instead of a Protobuf response
  • /complex: Sends a POST request via Protobuf and receives a paged response via Protobuf

Run

$ go run rest-ptbuf/cmd/client/main.go

Dev

Run from module root: $ protoc --go_out=. proto/facto.proto

Add new modules to the workspace: $ go work use

References:

About

A toolbox of common go components.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages