@@ -99,6 +99,9 @@ import (
99
99
" time"
100
100
101
101
" github.com/tarantool/go-tarantool/v2"
102
+ _ " github.com/tarantool/go-tarantool/v2/datetime"
103
+ _ " github.com/tarantool/go-tarantool/v2/decimal"
104
+ _ " github.com/tarantool/go-tarantool/v2/uuid"
102
105
)
103
106
104
107
func main () {
@@ -131,19 +134,22 @@ func main() {
131
134
** Observation 1:** The line "` github.com/tarantool/go-tarantool/v2 ` " in the
132
135
` import(...) ` section brings in all Tarantool-related functions and structures.
133
136
134
- ** Observation 2:** The line starting with "` ctx, cancel := ` " creates a context
137
+ ** Observation 2:** Unused import lines are required to initialize encoders and
138
+ decoders for external ` msgpack ` types.
139
+
140
+ ** Observation 3:** The line starting with "` ctx, cancel := ` " creates a context
135
141
object for ` Connect() ` . The ` Connect() ` call will return an error when a
136
142
timeout expires before the connection is established.
137
143
138
- ** Observation 3 :** The line starting with "` dialer := ` " creates dialer for
144
+ ** Observation 4 :** The line starting with "` dialer := ` " creates dialer for
139
145
` Connect() ` . This structure contains fields required to establish a connection.
140
146
141
- ** Observation 4 :** The line starting with "` opts := ` " sets up the options for
147
+ ** Observation 5 :** The line starting with "` opts := ` " sets up the options for
142
148
` Connect() ` . In this example, the structure contains only a single value, the
143
149
timeout. The structure may also contain other settings, see more in
144
150
[ documentation] [ godoc-opts-url ] for the "` Opts ` " structure.
145
151
146
- ** Observation 5 :** The line containing "` tarantool.Connect ` " is essential for
152
+ ** Observation 6 :** The line containing "` tarantool.Connect ` " is essential for
147
153
starting a session. There are three parameters:
148
154
149
155
* a context,
@@ -155,10 +161,10 @@ There will be only one attempt to connect. If multiple attempts needed,
155
161
between each try. Example could be found in the [ example_test] ( ./example_test.go ) ,
156
162
name - ` ExampleConnect_reconnects ` .
157
163
158
- ** Observation 6 :** The ` err ` structure will be ` nil ` if there is no error,
164
+ ** Observation 7 :** The ` err ` structure will be ` nil ` if there is no error,
159
165
otherwise it will have a description which can be retrieved with ` err.Error() ` .
160
166
161
- ** Observation 7 :** The ` Insert ` request, like almost all requests, is preceded
167
+ ** Observation 8 :** The ` Insert ` request, like almost all requests, is preceded
162
168
by the method ` Do ` of object ` conn ` which is the object that was returned
163
169
by ` Connect() ` .
164
170
@@ -179,6 +185,9 @@ import (
179
185
" time"
180
186
181
187
" github.com/tarantool/go-tarantool/v2"
188
+ _ " github.com/tarantool/go-tarantool/v2/datetime"
189
+ _ " github.com/tarantool/go-tarantool/v2/decimal"
190
+ _ " github.com/tarantool/go-tarantool/v2/uuid"
182
191
" github.com/tarantool/go-tlsdialer"
183
192
)
184
193
0 commit comments