diff --git a/connection.go b/connection.go index 6532cba..67bdaeb 100644 --- a/connection.go +++ b/connection.go @@ -1,21 +1,21 @@ package rethinkdb import ( + "bytes" "crypto/tls" "encoding/binary" "encoding/json" "fmt" "net" + "sync" "sync/atomic" "time" - "bytes" "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/ext" "github.com/opentracing/opentracing-go/log" "golang.org/x/net/context" p "gopkg.in/rethinkdb/rethinkdb-go.v6/ql2" - "sync" ) const ( @@ -41,8 +41,7 @@ type Response struct { Profile interface{} `json:"p"` } -// Connection is a connection to a rethinkdb database. Connection is not thread -// safe and should only be accessed be a single goroutine +// Connection is a connection to a RethinkDB database. type Connection struct { net.Conn diff --git a/cursor.go b/cursor.go index 170ca83..422b64a 100644 --- a/cursor.go +++ b/cursor.go @@ -43,10 +43,8 @@ func newCursor(ctx context.Context, conn *Connection, cursorType string, token i return cursor } -// Cursor is the result of a query. Its cursor starts before the first row -// of the result set. A Cursor is not thread safe and should only be accessed -// by a single goroutine at any given time. Use Next to advance through the -// rows: +// Cursor is the result of a query. It starts before the first row +// of the result set. Use Next to advance through the rows: // // cursor, err := query.Run(session) // ... diff --git a/pool.go b/pool.go index 3b13387..4fd29a5 100644 --- a/pool.go +++ b/pool.go @@ -19,7 +19,7 @@ const ( type connFactory func(host string, opts *ConnectOpts) (*Connection, error) -// A Pool is used to store a pool of connections to a single RethinkDB server +// Pool evenly distributes queries across a set of connections to a RethinkDB server. type Pool struct { host Host opts *ConnectOpts