Skip to content
No description, website, or topics provided.
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
client
schema
server
templates
.gitignore
go.mod
go.sum
readme.md

readme.md

remoto-rpc-framework

This repository is written to support the blog post here.

Install Remoto

go get -v github.com/machinebox/remoto

Download this repo and build

git clone https://github.com/PrakharSrivastav/remoto-rpc-framework.git
cd remoto-rpc-framework
go build ./...

Generation scripts

Required only for generating the code from schema files. Ignore if you just want to run and the client and server.

# server code generation
remoto generate  schema/bank.remoto.go templates/client.go.plush -o client/stub/stub.go \
&& gofmt -w ./client/stub/stub.go

# client code generation
remoto generate  schema/bank.remoto.go templates/server.go.plush -o server/skeleton/service.go \
&& gofmt -w ./server/skeleton/service.go

Run the server

from the project root, run:

prakhar@tardis (master)✗ % go run server/server.go  
starting server on 8080
endpoint: /remoto/Bank.Balance
endpoint: /remoto/Bank.Pay
endpoint: /remoto/Bank.WithDraw

Run the client

from the project root, run:

prakhar@tardis (master)✗ [1] % go run client/client.go
&stub.Response{OK:true, Message:"Amount credited", Amount:100, Error:""} 
You can’t perform that action at this time.