Implement HTTP POST based RPC (#5840)

Added support for new RPC support using HTTP POST.  RPC's 
arguments and reply are Gob encoded and sent as HTTP 
request/response body.

This patch also removes Go RPC based implementation.
This commit is contained in:
Bala FA
2018-06-06 14:21:56 +05:30
committed by Nitish Tiwari
parent 9d41051e91
commit 6a53dd1701
59 changed files with 5272 additions and 4169 deletions

View File

@@ -17,25 +17,25 @@
package cmd
import (
"fmt"
"testing"
"github.com/minio/dsync"
xnet "github.com/minio/minio/pkg/net"
)
// Tests lock rpc client.
func TestLockRPCClient(t *testing.T) {
lkClient := newLockRPCClient(authConfig{
accessKey: "abcd",
secretKey: "abcd123",
serverAddr: fmt.Sprintf("%X", UTCNow().UnixNano()),
serviceEndpoint: pathJoin(lockServicePath, "/test/1"),
secureConn: false,
serviceName: lockServiceName,
})
host, err := xnet.ParseHost("localhost:9000")
if err != nil {
t.Fatalf("unexpected error %v", err)
}
lkClient, err := NewLockRPCClient(host)
if err != nil {
t.Fatalf("unexpected error %v", err)
}
// Attempt all calls.
_, err := lkClient.RLock(dsync.LockArgs{})
_, err = lkClient.RLock(dsync.LockArgs{})
if err == nil {
t.Fatal("Expected for Rlock to fail")
}