twirp-example

module
v0.0.0-...-b4891db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2022 License: MIT

README

twirp-example

The simplest example of Twirp.

Directory structure

  • rpc/hello
    • service.proto - RPC definition
  • internal
    • helloserver - Server implementation
  • cmd
    • server - main function for the server

Requirement

  • Docker
  • Go

Build and run server

Build server.

$ make proto-gen
$ make build-server

Run the server.

$ ./server

Send request to the server

$ curl -X POST -H 'Content-Type: application/json' -d '{"message": "mercari.go #18"}' http://localhost:8080/twirp/twirp.example.hello.Hello/Echo

Directories

Path Synopsis
cmd
internal
rpc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL