Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hakobera/msgpack-rpc-over-http-go
[Golang] client library for msgpack-rpc-over-http
https://github.com/hakobera/msgpack-rpc-over-http-go
Last synced: about 1 month ago
JSON representation
[Golang] client library for msgpack-rpc-over-http
- Host: GitHub
- URL: https://github.com/hakobera/msgpack-rpc-over-http-go
- Owner: hakobera
- License: mit
- Created: 2014-08-04T17:14:13.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-04T18:09:12.000Z (over 10 years ago)
- Last Synced: 2024-04-14T09:15:53.840Z (8 months ago)
- Language: Go
- Size: 152 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# msgpack-rpc-over-http-go
Client library for [msgpack-rpc-over-http](https://github.com/authorNari/msgpack-rpc-over-http) for Go.
[![Build Status](https://travis-ci.org/hakobera/msgpack-rpc-over-http-go.svg?branch=master)](https://travis-ci.org/hakobera/msgpack-rpc-over-http-go)
## Install
```
$ go get github.com/hakobera/msgpack-rpc-over-http-go
```## Usage
If server code is followings:
```ruby
require 'msgpack-rpc-over-http'
class MyHandler
def add(x,y) return x+y end
endrun MessagePack::RPCOverHTTP::Server.app(MyHandler.new)
```Client code is like this:
```go
package mainimport (
"fmt"
"os"
"github.com/hakobera/msgpack-rpc-over-http-go/overhttp"
)func main() {
url := "http://localhost:9000"
opts := make(map[string]int32)
client := overhttp.NewMsgpackClient(url, &opts)ret, err := client.Call("add", 1, 2)
if err != nil {
fmt.Printf("got %v", err)
os.Exit(1)
}fmt.Printf("result is %v", ret)
}
```