// NewClientCodec returns a new core.ClientCodec using MessagePack-RPC on conn.
507646
func NewClientCodec(conn io.ReadWriteCloser) core.ClientCodec {
	return NewCodec(true, true, conn)
}
252117
func NewClient(host string, client *http.Client) access.AccessClient {
	return access.NewAccessPRPCClient(&prpc.Client{
		Host: host,
		C:    client,
	})
}
60758
func NewClientWithCodec(codec rpc.ClientCodec) *Client {
	client := rpc.NewClientWithCodec(codec)
	return &Client{client, codec}
}
613164
func NewRPCClient(cluster *Cluster, mvccStore MVCCStore) *RPCClient {
	ch := make(chan *tikvrpc.Lease)
	go tikvrpc.CheckStreamTimeoutLoop(ch)
	return &RPCClient{
		Cluster:       cluster,
		MvccStore:     mvccStore,
		streamTimeout: ch,
	}
}
716768
func CustomCodec(codec Codec) ServerOption {
	return newFuncServerOption(func(o *serverOptions) {
		o.codec = codec
	})
}
1212336
func NewClient(
	ctx context.Context,
	gcKeyFile string,
	projectID string,
	options ...interface{},
) (*Client, error) {
	queueSize := OptionUploaderQueueSizeDefault
	errorHandler := OptionUploaderErrorHandlerDefault
	ensureDataset := OptionEnsureDatasetWhenFirstUploadDefault
	ensureTable := OptionEnsureTableWhenFirstUploadDefault
	for _, option := range options {
		switch opt := option.(type) {
		case OptionUploaderQueueSize:
			queueSize = opt
		case OptionUploaderErrorHandler:
			errorHandler = opt
		case OptionEnsureDatasetWhenFirstUpload:
			ensureDataset = opt
		case OptionEnsureTableWhenFirstUpload:
			ensureTable = opt
		default:
			return nil, ErrUnknownOption2.New(nil, option, opt)
		}
	}

	client, err := bigquery.NewClient(
		ctx,
		projectID,
		option.WithServiceAccountFile(gcKeyFile),
	)
	if err != nil {
		return nil, err
	}

	msgQueue := make(chan uploadMessage, queueSize)
	go startUploaderLoop(ctx, msgQueue, errorHandler)

	return &Client{
		ctx:           ctx,
		client:        client,
		msgQueue:      msgQueue,
		ensureDataset: ensureDataset,
		ensureTable:   ensureTable,
	}, nil
}
589372
func NewClient(conn io.ReadWriteCloser) *rpc.Client {
	return rpc.NewClientWithCodec(NewClientCodec(conn))
}
737937
func newClient(ifi *net.Interface, p net.PacketConn, addrs []net.Addr) (*Client, error) {
	ip, err := firstIPv4Addr(addrs)
	if err != nil {
		return nil, err
	}

	return &Client{
		ifi: ifi,
		ip:  ip,
		p:   p,
	}, nil
}
358110
func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec {
	return &clientCodec{
		dec:     json.NewDecoder(conn),
		enc:     json.NewEncoder(conn),
		c:       conn,
		pending: make(map[uint64]string),
	}
}
1193147
func NewClient(name string, c envelope.Client) envelope.Client {
	return client{name: name, c: c}
}
340994
func NewClient(opts *NewClientOptions) (*Client, error) {
	if opts == nil {
		return nil, ErrClientOptionsRequired
	}
	if opts.Cluster != nil {
		return newClientUsingCluster(opts.Cluster)
	}
	if opts.RemoteAddresses != nil {
		return newClientUsingAddresses(opts.Port, opts.RemoteAddresses)
	}
	return nil, ErrClientMissingRequiredData
}
86752
func NewClient(accessKeyId, accessKeySecret string) *Client {
	return &Client{
		AccessKeyId:     accessKeyId,
		AccessKeySecret: accessKeySecret,
		endpoint:        CSDefaultEndpoint,
		Version:         CSAPIVersion,
		httpClient:      &http.Client{},
	}
}
1040364
func NewClientWithCodec(codec Codec) *Client {
	return &Client{
		codec:      codec,
		pending:    make(map[uint64]*Call),
		handlers:   make(map[string]*handler),
		disconnect: make(chan struct{}),
		seq:        1, // 0 means notification.
	}
}
311677
func NewClientWithCoder(cluster []string, coder *Coder) *Client {
	return &Client{
		cluster:       cluster,
		pool:          NewPool(cluster),
		Coder:         coder,
		logging:       false,
		pingFrequency: 1000,
		closed:        make(chan struct{}),
	}
}
695124
func NewClient(config *Config) (*Client, error) {
	c, err := tlsutil.NewConfigurator(config.ToTLSUtilConfig(), nil)
	if err != nil {
		return nil, err
	}
	return NewClientLogger(config, nil, c)
}
1262683
func NewClient(conn *rpcc.Conn) *Client {
	return &Client{
		Accessibility:        accessibility.NewClient(conn),
		Animation:            animation.NewClient(conn),
		ApplicationCache:     applicationcache.NewClient(conn),
		Audits:               audits.NewClient(conn),
		BackgroundService:    backgroundservice.NewClient(conn),
		Browser:              browser.NewClient(conn),
		CSS:                  css.NewClient(conn),
		CacheStorage:         cachestorage.NewClient(conn),
		Cast:                 cast.NewClient(conn),
		Console:              console.NewClient(conn),
		DOM:                  dom.NewClient(conn),
		DOMDebugger:          domdebugger.NewClient(conn),
		DOMSnapshot:          domsnapshot.NewClient(conn),
		DOMStorage:           domstorage.NewClient(conn),
		Database:             database.NewClient(conn),
		Debugger:             debugger.NewClient(conn),
		DeviceOrientation:    deviceorientation.NewClient(conn),
		Emulation:            emulation.NewClient(conn),
		Fetch:                fetch.NewClient(conn),
		HeadlessExperimental: headlessexperimental.NewClient(conn),
		HeapProfiler:         heapprofiler.NewClient(conn),
		IO:                   io.NewClient(conn),
		IndexedDB:            indexeddb.NewClient(conn),
		Input:                input.NewClient(conn),
		Inspector:            inspector.NewClient(conn),
		LayerTree:            layertree.NewClient(conn),
		Log:                  log.NewClient(conn),
		Memory:               memory.NewClient(conn),
		Network:              network.NewClient(conn),
		Overlay:              overlay.NewClient(conn),
		Page:                 page.NewClient(conn),
		Performance:          performance.NewClient(conn),
		Profiler:             profiler.NewClient(conn),
		Runtime:              runtime.NewClient(conn),
		Schema:               schema.NewClient(conn),
		Security:             security.NewClient(conn),
		ServiceWorker:        serviceworker.NewClient(conn),
		Storage:              storage.NewClient(conn),
		SystemInfo:           systeminfo.NewClient(conn),
		Target:               target.NewClient(conn),
		Tethering:            tethering.NewClient(conn),
		Tracing:              tracing.NewClient(conn),
	}
}
214554
func NewClient(conn io.ReadWriteCloser) *Client {
	encBuf := bufio.NewWriter(conn)
	client := &gobClientCodec{conn, gob.NewDecoder(conn), gob.NewEncoder(encBuf), encBuf}
	return NewClientWithCodec(client)
}