func Dial(url string) (*Session, error) {
	session, err := DialWithTimeout(url, 10*time.Second)
	if err == nil {
		session.SetSyncTimeout(1 * time.Minute)
		session.SetSocketTimeout(1 * time.Minute)
	}
	return session, err
}
Dial establishes a new session to the cluster identified by the given seed
server(s). The session will enable communication with all of the servers in
the cluster, so the seed servers are used only to find out about the cluster
topology.

Dial will timeout after 10 seconds if a server isn't reached. The returned
session will timeout operations after one minute by default if servers
aren't available. To customize the timeout, see DialWithTimeout,
SetSyncTimeout, and SetSocketTimeout.

This method is generally called just once for a given cluster.  Further
sessions to the same cluster are then established using the New or Copy
methods on the obtained session. This will make them share the underlying
cluster, and manage the pool of connections appropriately.

Once the session is not useful anymore, Close must be called to release the
resources appropriately.

The seed servers must be provided in the following format:

[mongodb://][user:pass@]host1[:port1][,host2[:port2],...][/database][?options]

For example, it may be as simple as:

localhost

Or more involved like:

mongodb://myuser:mypass@localhost:40001,otherhost:40001/mydb

If the port number is not provided for a server, it defaults to 27017.

The username and password provided in the URL will be used to authenticate
into the database named after the slash at the end of the host names, or
into the "admin" database if none is provided.  The authentication information
will persist in sessions obtained through the New method as well.

The following connection options are supported after the question mark:

connect=direct

Disables the automatic replica set server discovery logic, and
forces the use of servers provided only (even if secondaries).
Note that to talk to a secondary the consistency requirements
must be relaxed to Monotonic or Eventual via SetMode.


connect=replicaSet

Discover replica sets automatically. Default connection behavior.


replicaSet=<setname>

If specified will prevent the obtained session from communicating
with any server which is not part of a replica set with the given name.
The default is to communicate with any server specified or discovered
via the servers contacted.


authSource=<db>

Informs the database used to establish credentials and privileges
with a MongoDB server. Defaults to the database name provided via
the URL path, and "admin" if that's unset.


authMechanism=<mechanism>

Defines the protocol for credential negotiation. Defaults to "MONGODB-CR",
which is the default username/password challenge-response mechanism.


gssapiServiceName=<name>

Defines the service name to use when authenticating with the GSSAPI
mechanism. Defaults to "mongodb".


maxPoolSize=<limit>

Defines the per-server socket pool limit. Defaults to 4096.
See Session.SetPoolLimit for details.


Relevant documentation:

http://docs.mongodb.org/manual/reference/connection-string/
package mgo
import (
	"crypto/md5"
	"encoding/hex"
	"errors"
	"fmt"
	"math"
	"net"
	"net/url"
	"reflect"
	"sort"
	"strconv"
	"strings"
	"sync"
	"time"
	"gopkg.in/mgo.v2/bson"
)
type Mode int
const (
	Primary            Mode = 2  
	PrimaryPreferred   Mode = 3  
	Secondary          Mode = 4  
	SecondaryPreferred Mode = 5  
	Nearest            Mode = 6  
	Eventual  Mode = 0  
	Monotonic Mode = 1  
	Strong    Mode = 2  
)
type Session struct {
	m                sync.RWMutex
	cluster_         *mongoCluster
	slaveSocket      *mongoSocket
	masterSocket     *mongoSocket
	slaveOk          bool
	consistency      Mode
	queryConfig      query
	safeOp           *queryOp
	syncTimeout      time.Duration
	sockTimeout      time.Duration
	defaultdb        string
	sourcedb         string
	dialCred         *Credential
	creds            []Credential
	poolLimit        int
	bypassValidation bool
}
type Database struct {
	Session *Session
	Name    string
}
type Collection struct {
	Database *Database
	Name     string  
	FullName string  
}
type Query struct {
	m       sync.Mutex
	session *Session
	query    
}
type query struct {
	op       queryOp
	prefetch float64
	limit    int32
}
type getLastError struct {
	CmdName  int         "getLastError,omitempty"
	W        interface{} "w,omitempty"
	WTimeout int         "wtimeout,omitempty"
	FSync    bool        "fsync,omitempty"
	J        bool        "j,omitempty"
}
type Iter struct {
	m              sync.Mutex
	gotReply       sync.Cond
	session        *Session
	server         *mongoServer
	docData        queue
	err            error
	op             getMoreOp
	prefetch       float64
	limit          int32
	docsToReceive  int
	docsBeforeMore int
	timeout        time.Duration
	timedout       bool
	findCmd        bool
}
var (
	ErrNotFound = errors.New("not found")
	ErrCursor   = errors.New("invalid cursor")
)
const defaultPrefetch = 0.25