// NewConnectionStringBuilder will return an ConnectionStringBuilder
195419
func NewConnectionStringBuilder(endpoint, region, dbUser, dbName string, creds *credentials.Credentials) ConnectionStringBuilder {
	return ConnectionStringBuilder{
		dbName:   dbName,
		endpoint: endpoint,
		region:   region,
		user:     dbUser,
		creds:    creds,
	}
}
390842
func NewConnector(svrAddr string, opts ...ClientOption) IOSession {
	sopts := &clientOptions{}
	for _, opt := range opts {
		opt(sopts)
	}
	sopts.adjust()

	return &connector{
		addr:  svrAddr,
		in:    NewByteBuf(sopts.readBufSize),
		out:   NewByteBuf(sopts.writeBufSize),
		opts:  sopts,
		attrs: make(map[string]interface{}),
	}
}
425185
func (s *Integration) SetConnectionType(v string) *Integration {
	s.ConnectionType = &v
	return s
}
818874
func NewDBConnection(info *mysql.ConnParams, mysqlStats *stats.Timings) (*DBConnection, error) {
	start := time.Now()
	defer mysqlStats.Record("Connect", start)
	params, err := dbconfigs.WithCredentials(info)
	if err != nil {
		return nil, err
	}
	ctx := context.Background()
	c, err := mysql.Connect(ctx, params)
	if err != nil {
		mysqlStats.Record("ConnectError", start)
	}
	return &DBConnection{c, mysqlStats}, err
}
721264
func (mux *Multiplexer) NewProtoConnection(name string, serializer keyval.Serializer) *ProtoConnection {
	return &ProtoConnection{ProtoConnectionFields{multiplexer: mux, serializer: serializer, name: name}}
}
1152463
func NewConnector(config Config, scope metrics.Scope) dosa.Connector {
	return &Connector{
		client:    NewRedigoClient(config.ServerSettings, scope),
		ttl:       config.TTL,
		stats:     metrics.CheckIfNilStats(scope),
		keyPrefix: config.KeyPrefix,
	}
}
311504
func (s *Connection) SetConnectionType(v string) *Connection {
	s.ConnectionType = &v
	return s
}
153897
func newConnection(network, address string, tlsConfig *tls.Config) (*connection, error) {
	// Define the local variables.
	var conn net.Conn
	var err error

	// Connect to the address on the named network.
	if tlsConfig != nil {
		conn, err = tls.Dial(network, address, tlsConfig)
	} else {
		conn, err = net.Dial(network, address)
	}
	if err != nil {
		return nil, err
	}

	// Create a Network Connection.
	c := &connection{
		Conn:      conn,
		r:         bufio.NewReader(conn),
		w:         bufio.NewWriter(conn),
		connack:   make(chan struct{}, 1),
		send:      make(chan packet.Packet, sendBufSize),
		sendEnd:   make(chan struct{}, 1),
		unackSubs: make(map[string]MessageHandler),
		ackedSubs: make(map[string]MessageHandler),
	}

	// Return the Network Connection.
	return c, nil
}
933543
func newConnection(s *websocket.Conn, r *Router) *Connection {
	return &Connection{
		socket:    s,
		router:    r,
		send:      make(chan *message, sendChannelSize),
		extension: nil,
	}
}
518618
func (n *NotifyRouter) AddConnection(xp rpc.Transporter, ch chan error) ConnectionID {
	if n == nil {
		return 0
	}
	id := n.cm.AddConnection(xp, ch)
	n.setNotificationChannels(id, keybase1.NotificationChannels{})
	return id
}
893291
func NewConnection(solrUrl, core string) (*Connection, error) {
	u, err := url.ParseRequestURI(strings.TrimRight(solrUrl, "/"))
	if err != nil {
		return nil, err
	}
	return &Connection{url: u, core: core}, nil
}
580658
func (ftp *FTP) newConnection(port int) (conn net.Conn, err error) {
	addr := fmt.Sprintf("%s:%d", strings.Split(ftp.addr, ":")[0], port)

	if ftp.debug {
		log.Printf("Connecting to %s\n", addr)
	}

	if conn, err = net.Dial("tcp", addr); err != nil {
		return
	}

	if ftp.tlsconfig != nil {
		conn = tls.Client(conn, ftp.tlsconfig)
	}

	return
}
682553
func newConnection() (*Conn, error) {
	c := new(Conn)
	if err := c.initConnection(); err != nil {
		return nil, err
	}

	return c, nil
}
765810
func (p *Plugin) NewBytesConnection(name string) *mux.BytesConnectionStr {
	return p.mux.NewBytesConnection(name)
}
1005031
func NewConnectionPool() *ConnectionPool {
	// The second argument is the maximum number of idle connections
	redisPool := &redis.Pool{
		MaxIdle:     maxIdleConnections,
		IdleTimeout: idleTimeout,
		Dial:        newRedisConnection,
	}
	pool := ConnectionPool(*redisPool)
	return &pool
}
1085703
func NewConnection(port xspi.PortCloser, conn xspi.Conn) (connection *SpiConnection) {
	return &SpiConnection{port: port, dev: conn}
}
634292
func NewConnectResults(results ...ConnectResult) ConnectAttemptResults {
	mapResults := make(map[Attempt]ConnectResult)
	for _, r := range results {
		mapResults[r.Attempt] = r
	}
	return mapResults
}