@@ -179,11 +179,11 @@ func ExamplePingRequest_Context() {
179
179
req := tarantool .NewPingRequest ().Context (ctx )
180
180
181
181
// Ping a Tarantool instance to check connection.
182
- resp , err := conn .Do (req ).GetResponse ()
183
- fmt .Println ("Ping Resp" , resp )
182
+ data , err := conn .Do (req ).Get ()
183
+ fmt .Println ("Ping Resp data " , data )
184
184
fmt .Println ("Ping Error" , err )
185
185
// Output:
186
- // Ping Resp <nil>
186
+ // Ping Resp data []
187
187
// Ping Error context is done
188
188
}
189
189
@@ -701,7 +701,6 @@ func getTestTxnDialer() tarantool.Dialer {
701
701
702
702
func ExampleCommitRequest () {
703
703
var req tarantool.Request
704
- var resp tarantool.Response
705
704
var err error
706
705
707
706
// Tarantool supports streams and interactive transactions since version 2.10.0
@@ -718,22 +717,22 @@ func ExampleCommitRequest() {
718
717
719
718
// Begin transaction
720
719
req = tarantool .NewBeginRequest ()
721
- resp , err = stream .Do (req ).GetResponse ()
720
+ data , err : = stream .Do (req ).Get ()
722
721
if err != nil {
723
722
fmt .Printf ("Failed to Begin: %s" , err .Error ())
724
723
return
725
724
}
726
- fmt .Printf ("Begin transaction: response is %#v\n " , resp )
725
+ fmt .Printf ("Begin transaction: response is %#v\n " , data )
727
726
728
727
// Insert in stream
729
728
req = tarantool .NewInsertRequest (spaceName ).
730
729
Tuple ([]interface {}{uint (1001 ), "commit_hello" , "commit_world" })
731
- resp , err = stream .Do (req ).GetResponse ()
730
+ data , err = stream .Do (req ).Get ()
732
731
if err != nil {
733
732
fmt .Printf ("Failed to Insert: %s" , err .Error ())
734
733
return
735
734
}
736
- fmt .Printf ("Insert in stream: response is %#v\n " , resp )
735
+ fmt .Printf ("Insert in stream: response is %#v\n " , data )
737
736
738
737
// Select not related to the transaction
739
738
// while transaction is not committed
@@ -743,7 +742,7 @@ func ExampleCommitRequest() {
743
742
Limit (1 ).
744
743
Iterator (tarantool .IterEq ).
745
744
Key ([]interface {}{uint (1001 )})
746
- data , err : = conn .Do (selectReq ).Get ()
745
+ data , err = conn .Do (selectReq ).Get ()
747
746
if err != nil {
748
747
fmt .Printf ("Failed to Select: %s" , err .Error ())
749
748
return
@@ -760,12 +759,12 @@ func ExampleCommitRequest() {
760
759
761
760
// Commit transaction
762
761
req = tarantool .NewCommitRequest ()
763
- resp , err = stream .Do (req ).GetResponse ()
762
+ data , err = stream .Do (req ).Get ()
764
763
if err != nil {
765
764
fmt .Printf ("Failed to Commit: %s" , err .Error ())
766
765
return
767
766
}
768
- fmt .Printf ("Commit transaction: response is %#v\n " , resp )
767
+ fmt .Printf ("Commit transaction: response is %#v\n " , data )
769
768
770
769
// Select outside of transaction
771
770
data , err = conn .Do (selectReq ).Get ()
@@ -778,7 +777,6 @@ func ExampleCommitRequest() {
778
777
779
778
func ExampleRollbackRequest () {
780
779
var req tarantool.Request
781
- var resp tarantool.Response
782
780
var err error
783
781
784
782
// Tarantool supports streams and interactive transactions since version 2.10.0
@@ -795,22 +793,22 @@ func ExampleRollbackRequest() {
795
793
796
794
// Begin transaction
797
795
req = tarantool .NewBeginRequest ()
798
- resp , err = stream .Do (req ).GetResponse ()
796
+ data , err : = stream .Do (req ).Get ()
799
797
if err != nil {
800
798
fmt .Printf ("Failed to Begin: %s" , err .Error ())
801
799
return
802
800
}
803
- fmt .Printf ("Begin transaction: response is %#v\n " , resp )
801
+ fmt .Printf ("Begin transaction: response is %#v\n " , data )
804
802
805
803
// Insert in stream
806
804
req = tarantool .NewInsertRequest (spaceName ).
807
805
Tuple ([]interface {}{uint (2001 ), "rollback_hello" , "rollback_world" })
808
- resp , err = stream .Do (req ).GetResponse ()
806
+ data , err = stream .Do (req ).Get ()
809
807
if err != nil {
810
808
fmt .Printf ("Failed to Insert: %s" , err .Error ())
811
809
return
812
810
}
813
- fmt .Printf ("Insert in stream: response is %#v\n " , resp )
811
+ fmt .Printf ("Insert in stream: response is %#v\n " , data )
814
812
815
813
// Select not related to the transaction
816
814
// while transaction is not committed
@@ -820,7 +818,7 @@ func ExampleRollbackRequest() {
820
818
Limit (1 ).
821
819
Iterator (tarantool .IterEq ).
822
820
Key ([]interface {}{uint (2001 )})
823
- data , err : = conn .Do (selectReq ).Get ()
821
+ data , err = conn .Do (selectReq ).Get ()
824
822
if err != nil {
825
823
fmt .Printf ("Failed to Select: %s" , err .Error ())
826
824
return
@@ -837,12 +835,12 @@ func ExampleRollbackRequest() {
837
835
838
836
// Rollback transaction
839
837
req = tarantool .NewRollbackRequest ()
840
- resp , err = stream .Do (req ).GetResponse ()
838
+ data , err = stream .Do (req ).Get ()
841
839
if err != nil {
842
840
fmt .Printf ("Failed to Rollback: %s" , err .Error ())
843
841
return
844
842
}
845
- fmt .Printf ("Rollback transaction: response is %#v\n " , resp )
843
+ fmt .Printf ("Rollback transaction: response is %#v\n " , data )
846
844
847
845
// Select outside of transaction
848
846
data , err = conn .Do (selectReq ).Get ()
@@ -855,7 +853,6 @@ func ExampleRollbackRequest() {
855
853
856
854
func ExampleBeginRequest_TxnIsolation () {
857
855
var req tarantool.Request
858
- var resp tarantool.Response
859
856
var err error
860
857
861
858
// Tarantool supports streams and interactive transactions since version 2.10.0
@@ -874,22 +871,22 @@ func ExampleBeginRequest_TxnIsolation() {
874
871
req = tarantool .NewBeginRequest ().
875
872
TxnIsolation (tarantool .ReadConfirmedLevel ).
876
873
Timeout (500 * time .Millisecond )
877
- resp , err = stream .Do (req ).GetResponse ()
874
+ data , err : = stream .Do (req ).Get ()
878
875
if err != nil {
879
876
fmt .Printf ("Failed to Begin: %s" , err .Error ())
880
877
return
881
878
}
882
- fmt .Printf ("Begin transaction: response is %#v\n " , resp )
879
+ fmt .Printf ("Begin transaction: response is %#v\n " , data )
883
880
884
881
// Insert in stream
885
882
req = tarantool .NewInsertRequest (spaceName ).
886
883
Tuple ([]interface {}{uint (2001 ), "rollback_hello" , "rollback_world" })
887
- resp , err = stream .Do (req ).GetResponse ()
884
+ data , err = stream .Do (req ).Get ()
888
885
if err != nil {
889
886
fmt .Printf ("Failed to Insert: %s" , err .Error ())
890
887
return
891
888
}
892
- fmt .Printf ("Insert in stream: response is %#v\n " , resp )
889
+ fmt .Printf ("Insert in stream: response is %#v\n " , data )
893
890
894
891
// Select not related to the transaction
895
892
// while transaction is not committed
@@ -899,7 +896,7 @@ func ExampleBeginRequest_TxnIsolation() {
899
896
Limit (1 ).
900
897
Iterator (tarantool .IterEq ).
901
898
Key ([]interface {}{uint (2001 )})
902
- data , err : = conn .Do (selectReq ).Get ()
899
+ data , err = conn .Do (selectReq ).Get ()
903
900
if err != nil {
904
901
fmt .Printf ("Failed to Select: %s" , err .Error ())
905
902
return
@@ -916,12 +913,12 @@ func ExampleBeginRequest_TxnIsolation() {
916
913
917
914
// Rollback transaction
918
915
req = tarantool .NewRollbackRequest ()
919
- resp , err = stream .Do (req ).GetResponse ()
916
+ data , err = stream .Do (req ).Get ()
920
917
if err != nil {
921
918
fmt .Printf ("Failed to Rollback: %s" , err .Error ())
922
919
return
923
920
}
924
- fmt .Printf ("Rollback transaction: response is %#v\n " , resp )
921
+ fmt .Printf ("Rollback transaction: response is %#v\n " , data )
925
922
926
923
// Select outside of transaction
927
924
data , err = conn .Do (selectReq ).Get ()
@@ -1257,12 +1254,12 @@ func ExampleConnection_CloseGraceful_force() {
1257
1254
<- done
1258
1255
1259
1256
fmt .Println ("Result:" )
1260
- fmt .Println (fut .GetResponse ())
1257
+ fmt .Println (fut .Get ())
1261
1258
// Output:
1262
1259
// Force Connection.Close()!
1263
1260
// Connection.CloseGraceful() done!
1264
1261
// Result:
1265
- // <nil> connection closed by client (0x4001)
1262
+ // [] connection closed by client (0x4001)
1266
1263
}
1267
1264
1268
1265
func ExampleWatchOnceRequest () {
0 commit comments