File tree Expand file tree Collapse file tree 2 files changed +22
-23
lines changed Expand file tree Collapse file tree 2 files changed +22
-23
lines changed Original file line number Diff line number Diff line change @@ -32,15 +32,14 @@ import (
3232
3333var session *r.Session
3434
35- session , err := r.Connect (map [string ]interface {}{
36- " address" : " localhost:28015" ,
37- " database" : " test" ,
38- " authkey" : " 14daak1cad13dj" ,
39- })
40-
41- if err != nil {
42- log.Fatalln (err.Error ())
43- }
35+ session , err := r.Connect (r.ConnectOpts {
36+ Address : " localhost:28015" ,
37+ Database : " test" ,
38+ })
39+
40+ if err != nil {
41+ log.Fatalln (err.Error ())
42+ }
4443
4544```
4645See the [ documentation] ( http://godoc.org/github.com/dancannon/gorethink#Connect ) for a list of supported arguments to Connect().
@@ -56,16 +55,16 @@ import (
5655
5756var session *r.Session
5857
59- session , err := r.Connect (map [ string ] interface {} {
60- " address " : " localhost:28015" ,
61- " database " : " test" ,
62- " maxIdle " : 10 ,
63- " idleTimeout " : time.Second * 10 ,
64- })
58+ session , err := r.Connect (r. ConnectOpts {
59+ Address : " localhost:28015" ,
60+ Database : " test" ,
61+ MaxIdle : 10 ,
62+ IdleTimeout : time.Second * 10 ,
63+ })
6564
66- if err != nil {
67- log.Fatalln (err.Error ())
68- }
65+ if err != nil {
66+ log.Fatalln (err.Error ())
67+ }
6968```
7069
7170A pre-configured [ Pool] ( http://godoc.org/github.com/dancannon/gorethink#Pool ) instance can also be passed to Connect().
Original file line number Diff line number Diff line change @@ -92,11 +92,11 @@ func (o *ConnectOpts) toMap() map[string]interface{} {
9292// Basic connection example:
9393//
9494// var session *r.Session
95- // session, err := r.Connect(r.ConncetOpts {
96- // Address: "localhost:28015",
97- // Database: "test",
98- // AuthKey: "14daak1cad13dj",
99- // })
95+ // session, err := r.Connect(r.ConnectOpts {
96+ // Address: "localhost:28015",
97+ // Database: "test",
98+ // AuthKey: "14daak1cad13dj",
99+ // })
100100func Connect (args ConnectOpts ) (* Session , error ) {
101101 s := newSession (args .toMap ())
102102 err := s .Reconnect ()
You can’t perform that action at this time.
0 commit comments