Skip to content

Commit 2f550a3

Browse files
committed
api: add request types for remaining requests
This patch provides request types for remaining operations: Insert, Replace, Delete, Eval, Call, Call17 and Execute. Part of #126
1 parent e76117f commit 2f550a3

File tree

5 files changed

+677
-36
lines changed

5 files changed

+677
-36
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
1818
- queue-utube handling (#85)
1919
- Master discovery (#113)
2020
- SQL support (#62)
21-
- Public API with a request object for Select/Update/Upstream (#126)
21+
- Public API with request object types (#126)
2222

2323
### Fixed
2424

export_test.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,36 @@ import (
44
"gopkg.in/vmihailenco/msgpack.v2"
55
)
66

7+
// RefImplPingBody is reference implementation for filling of a ping
8+
// request's body.
9+
func RefImplPingBody(enc *msgpack.Encoder) error {
10+
return fillPing(enc)
11+
}
12+
713
// RefImplSelectBody is reference implementation for filling of a select
814
// request's body.
915
func RefImplSelectBody(enc *msgpack.Encoder, space, index, offset, limit, iterator uint32, key interface{}) error {
1016
return fillSelect(enc, space, index, offset, limit, iterator, key)
1117
}
1218

19+
// RefImplInsertBody is reference implementation for filling of an insert
20+
// request's body.
21+
func RefImplInsertBody(enc *msgpack.Encoder, space uint32, tuple interface{}) error {
22+
return fillInsert(enc, space, tuple)
23+
}
24+
25+
// RefImplReplaceBody is reference implementation for filling of a replace
26+
// request's body.
27+
func RefImplReplaceBody(enc *msgpack.Encoder, space uint32, tuple interface{}) error {
28+
return fillInsert(enc, space, tuple)
29+
}
30+
31+
// RefImplDeleteBody is reference implementation for filling of a delete
32+
// request's body.
33+
func RefImplDeleteBody(enc *msgpack.Encoder, space, index uint32, key interface{}) error {
34+
return fillDelete(enc, space, index, key)
35+
}
36+
1337
// RefImplUpdateBody is reference implementation for filling of an update
1438
// request's body.
1539
func RefImplUpdateBody(enc *msgpack.Encoder, space, index uint32, key, ops interface{}) error {
@@ -21,3 +45,21 @@ func RefImplUpdateBody(enc *msgpack.Encoder, space, index uint32, key, ops inter
2145
func RefImplUpsertBody(enc *msgpack.Encoder, space uint32, tuple, ops interface{}) error {
2246
return fillUpsert(enc, space, tuple, ops)
2347
}
48+
49+
// RefImplCallBody is reference implementation for filling of a call or call17
50+
// request's body.
51+
func RefImplCallBody(enc *msgpack.Encoder, function string, args interface{}) error {
52+
return fillCall(enc, function, args)
53+
}
54+
55+
// RefImplEvalBody is reference implementation for filling of an eval
56+
// request's body.
57+
func RefImplEvalBody(enc *msgpack.Encoder, expr string, args interface{}) error {
58+
return fillEval(enc, expr, args)
59+
}
60+
61+
// RefImplExecuteBody is reference implementation for filling of an execute
62+
// request's body.
63+
func RefImplExecuteBody(enc *msgpack.Encoder, expr string, args interface{}) error {
64+
return fillExecute(enc, expr, args)
65+
}

0 commit comments

Comments
 (0)