// New client with write key.
507201
func New(key string) *Client {
	c := &Client{
		Endpoint: Endpoint,
		Interval: 5 * time.Second,
		Size:     250,
		Logger:   log.New(os.Stderr, "segment ", log.LstdFlags),
		Verbose:  false,
		Client:   *http.DefaultClient,
		key:      key,
		msgs:     make(chan interface{}, 100),
		quit:     make(chan struct{}),
		shutdown: make(chan struct{}),
		now:      time.Now,
		uid:      uid,
	}

	c.logf("You are currently using the v2 version analytics-go, which is being deprecated. Please update to v3 as soon as you can https://segment.com/docs/sources/server/go/#migrating-from-v2")

	c.upcond.L = &c.upmtx
	return c
}
1251931
func NewClient(gateway, certificateFile, keyFile string) (c *Client) {
	c = new(Client)
	c.Gateway = gateway
	c.CertificateFile = certificateFile
	c.KeyFile = keyFile
	return
}
850640
func NewClient(keyRing, keyId, challengeIP string) (*Client, error) {
	signer, err := secretKeyEntity(keyRing, keyId)
	if err != nil {
		return nil, fmt.Errorf("could not get signer %v from keyRing %v: %v", keyId, keyRing, err)
	}
	cl := &Client{
		keyRing:     keyRing,
		keyId:       keyId,
		signer:      signer,
		challengeIP: challengeIP,
		errc:        make(chan error, 1),
	}
	handler := &clientHandler{
		cl: cl,
	}
	cl.handler = handler
	return cl, nil
}
421391
func NewClient(accessKeyId, accessKeySecret string) *Client {
	return &Client{
		accessKeyId:     accessKeyId,
		accessKeySecret: accessKeySecret,
		internal:        false,
		//region:          region,
		version:    APIVersion,
		endpoint:   DefaultEndpoint,
		httpClient: &http.Client{},
	}
}
597682
func NewClient(endpoint *Endpoint, user, password string) (*Client, error) {
	return NewClientWithParameters(endpoint, user, password, DefaultParameters)
}
1179008
func NewClient(appID, apiKey string) *Client {
	return NewClientWithConfig(
		Configuration{
			AppID:  appID,
			APIKey: apiKey,
		},
	)
}
1238457
func NewClient(config *Config) (*Client, error) {
	client := &Client{
		config: *config,
	}
	return client, nil
}
1141643
func NewClient(apiKey string) *Client {
	c := &Client{
		URL:        BaseURL,
		key:        apiKey,
		post:       http.PostForm,
		argMarshal: marshallArgs,
	}
	c.apiCall = c.liveAPICaller
	return c
}
398000
func New(c transport.ClientConfig, opts ...thrift.ClientOption) Interface {
	return client{
		c: thrift.New(thrift.Config{
			Service:      "Echo",
			ClientConfig: c,
		}, opts...),
	}
}
916636
func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec {
	return msgpackrpc.NewCodecFromHandle(true, true, conn, structs.HashiMsgpackHandle)
}
112923
func NewClient(accessKeyId, accessKeySecret string) *Client {
	endpoint := os.Getenv("KMS_ENDPOINT")
	if endpoint == "" {
		endpoint = KMSDefaultEndpoint
	}
	return NewClientWithEndpoint(endpoint, accessKeyId, accessKeySecret)
}
875613
func newClient(conn net.Conn, size int) *Client {
	if size <= 0 {
		size = defaultBufSize
	}
	return &Client{
		conn: conn,
		buf:  bufio.NewWriterSize(conn, size),
	}
}
229833
func New(addr string) *Client {
	return &Client{Address: addr, Client: &http.Client{}}
}
459983
func New() *Client {
	return &Client{
		Concurrency:    DefaultClient.Concurrency,
		MaxRetries:     DefaultClient.MaxRetries,
		Backoff:        DefaultClient.Backoff,
		ErrLog:         DefaultClient.ErrLog,
		wg:             &sync.WaitGroup{},
		RetryOnHTTP429: false,
	}
}
348550
func New(url string) *Client {
	return &Client{
		url:    url,
		logger: log.New(os.Stderr, "[discovery] ", log.LstdFlags),
	}
}
798078
func New(info metadata.ClientInfo, options ...ClientOpt) *Client {
	c := &Client{
		Info:     info,
		Handlers: request.DefaultHandlers(),
		HTTPClient: &http.Client{
			Timeout: 60 * time.Second,
			Transport: &http.Transport{
				Proxy: http.ProxyFromEnvironment,
				DialContext: (&net.Dialer{
					Timeout:   1 * time.Second,
					KeepAlive: 90 * time.Second,
				}).DialContext,
				TLSHandshakeTimeout: 3 * time.Second,
				MaxIdleConns:        100,
				MaxIdleConnsPerHost: 8,
				IdleConnTimeout:     90 * time.Second,
			},
		},
	}

	// Apply options
	for _, option := range options {
		option(c)
	}

	return c
}
114388
func NewClient(w io.Writer, r io.Reader) *Client {
	return &Client{
		r: NewReader(r),
		w: NewWriter(w),
	}
}