Skip to content

Commit efcd7ca

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 1a3c4fd commit efcd7ca

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
@@ -11,7 +11,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
1111
### Added
1212

1313
- SSL support (#155)
14-
- Public API with a request object for Select/Update/Upstream (#126)
14+
- Public API with request object types (#126)
1515

1616
### Changed
1717

export_test.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,36 @@ func SslCreateContext(opts SslOpts) (ctx interface{}, err error) {
1616
return sslCreateContext(opts)
1717
}
1818

19+
// RefImplPingBody is reference implementation for filling of a ping
20+
// request's body.
21+
func RefImplPingBody(enc *msgpack.Encoder) error {
22+
return fillPing(enc)
23+
}
24+
1925
// RefImplSelectBody is reference implementation for filling of a select
2026
// request's body.
2127
func RefImplSelectBody(enc *msgpack.Encoder, space, index, offset, limit, iterator uint32, key interface{}) error {
2228
return fillSelect(enc, space, index, offset, limit, iterator, key)
2329
}
2430

31+
// RefImplInsertBody is reference implementation for filling of an insert
32+
// request's body.
33+
func RefImplInsertBody(enc *msgpack.Encoder, space uint32, tuple interface{}) error {
34+
return fillInsert(enc, space, tuple)
35+
}
36+
37+
// RefImplReplaceBody is reference implementation for filling of a replace
38+
// request's body.
39+
func RefImplReplaceBody(enc *msgpack.Encoder, space uint32, tuple interface{}) error {
40+
return fillInsert(enc, space, tuple)
41+
}
42+
43+
// RefImplDeleteBody is reference implementation for filling of a delete
44+
// request's body.
45+
func RefImplDeleteBody(enc *msgpack.Encoder, space, index uint32, key interface{}) error {
46+
return fillDelete(enc, space, index, key)
47+
}
48+
2549
// RefImplUpdateBody is reference implementation for filling of an update
2650
// request's body.
2751
func RefImplUpdateBody(enc *msgpack.Encoder, space, index uint32, key, ops interface{}) error {
@@ -33,3 +57,21 @@ func RefImplUpdateBody(enc *msgpack.Encoder, space, index uint32, key, ops inter
3357
func RefImplUpsertBody(enc *msgpack.Encoder, space uint32, tuple, ops interface{}) error {
3458
return fillUpsert(enc, space, tuple, ops)
3559
}
60+
61+
// RefImplCallBody is reference implementation for filling of a call or call17
62+
// request's body.
63+
func RefImplCallBody(enc *msgpack.Encoder, function string, args interface{}) error {
64+
return fillCall(enc, function, args)
65+
}
66+
67+
// RefImplEvalBody is reference implementation for filling of an eval
68+
// request's body.
69+
func RefImplEvalBody(enc *msgpack.Encoder, expr string, args interface{}) error {
70+
return fillEval(enc, expr, args)
71+
}
72+
73+
// RefImplExecuteBody is reference implementation for filling of an execute
74+
// request's body.
75+
func RefImplExecuteBody(enc *msgpack.Encoder, expr string, args interface{}) error {
76+
return fillExecute(enc, expr, args)
77+
}

0 commit comments

Comments
 (0)