@@ -27,7 +27,7 @@ faster than other packages according to public benchmarks.
27
27
* [ API reference] ( #api-reference )
28
28
* [ Walking\- through example] ( #walking-through-example )
29
29
* [ Example with encrypting traffic] ( #example-with-encrypting-traffic )
30
- * [ Migration guide] ( #migration-guide )
30
+ * [ Migration guide] ( #migration-guide )
31
31
* [ Contributing] ( #contributing )
32
32
* [ Alternative connectors] ( #alternative-connectors )
33
33
@@ -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
@@ -216,7 +225,7 @@ func main() {
216
225
Note that [ traffic encryption] ( https://www.tarantool.io/en/doc/latest/enterprise/security/#encrypting-traffic )
217
226
is only available in Tarantool Enterprise Edition 2.10 or newer.
218
227
219
- ### Migration guide
228
+ ## Migration guide
220
229
221
230
You can review the changes between major versions in the
222
231
[ migration guide] ( ./MIGRATION.md ) .
0 commit comments