forked from fl00r/go-tarantool-1.6
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code-health: update format for
Call
to 1.7
An incompatible change was introduced in Tarantool 1.7 which was released in 2016. This change is about a new binary protocol command for CALL, which no more restricts a function to returning an array of tuples and allows returning an arbitrary MsgPack/JSON result, including scalars, nil and void (nothing). We should be in-line with tarantool here and provide `Call17` as just `Call` and rename current `Call` to `Call16`. Closes #125
- Loading branch information
Showing
21 changed files
with
257 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//go:build !go_tarantool_call_17 | ||
// +build !go_tarantool_call_17 | ||
|
||
package tarantool_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/tarantool/go-tarantool" | ||
) | ||
|
||
func TestConnection_Call(t *testing.T) { | ||
var resp *Response | ||
var err error | ||
|
||
conn := connect(t, server, opts) | ||
defer conn.Close() | ||
|
||
// Call16 | ||
resp, err = conn.Call("simple_incr", []interface{}{1}) | ||
if err != nil { | ||
t.Errorf("Failed to use Call") | ||
} | ||
if resp.Data[0].([]interface{})[0].(uint64) != 2 { | ||
t.Errorf("result is not {{1}} : %v", resp.Data) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//go:build go_tarantool_call_17 | ||
// +build go_tarantool_call_17 | ||
|
||
package tarantool_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/tarantool/go-tarantool" | ||
) | ||
|
||
func TestConnection_Call(t *testing.T) { | ||
var resp *Response | ||
var err error | ||
|
||
conn := connect(t, server, opts) | ||
defer conn.Close() | ||
|
||
// Call17 | ||
resp, err = conn.Call17("simple_incr", []interface{}{1}) | ||
if err != nil { | ||
t.Errorf("Failed to use Call") | ||
} | ||
if resp.Data[0].(uint64) != 2 { | ||
t.Errorf("result is not {{1}} : %v", resp.Data) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//go:build !go_tarantool_call_17 | ||
// +build !go_tarantool_call_17 | ||
|
||
package tarantool | ||
|
||
const ( | ||
CallRequest = 6 // CALL_16 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//go:build go_tarantool_call_17 | ||
// +build go_tarantool_call_17 | ||
|
||
package tarantool | ||
|
||
const ( | ||
CallRequest = 10 // CALL_17 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.