// Client returns a plugin client for the plugin described by the given metadata.
490316
func Client(m discovery.PluginMeta) *plugin.Client {
	return plugin.NewClient(ClientConfig(m))
}
858760
func Client(token string) (*godo.Client, error) {
	tokenSrc := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})

	client, err := godo.New(oauth2.NewClient(
		oauth2.NoContext, tokenSrc),
		godo.SetUserAgent(userAgent()))

	return client, err
}
511307
func (cl *Listener) AddClient(alpn string, client Client) {
	cl.l.Lock()
	cl.clients[alpn] = client
	cl.l.Unlock()
}
1183724
func (c *Client) Client() (ClientProtocol, error) {
	_, err := c.Start()
	if err != nil {
		return nil, err
	}

	c.l.Lock()
	defer c.l.Unlock()

	if c.client != nil {
		return c.client, nil
	}

	switch c.protocol {
	case ProtocolNetRPC:
		c.client, err = newRPCClient(c)

	case ProtocolGRPC:
		c.client, err = newGRPCClient(c.doneCtx, c)

	default:
		return nil, fmt.Errorf("unknown server protocol: %s", c.protocol)
	}

	if err != nil {
		c.client = nil
		return nil, err
	}

	return c.client, nil
}
1276545
func SimpleClient(nick string, args ...string) *Conn {
	conn := Client(NewConfig(nick, args...))
	return conn
}
426237
func InitClient(storeName string, storeURLs []string) (API, error) {
	plugin := GetPlugin(storeName)
	if plugin == nil {
		log.Errorf("Invalid DB type %s", storeName)
		return nil, errors.New("unsupported DB type")
	}
	cl, err := plugin.NewClient(storeURLs)
	if err != nil {
		log.Errorf("Error creating client %s to url %v. Err: %v", storeName, storeURLs, err)
		return nil, err
	}
	return cl, nil
}
1361364
func WithClient(client kinesisiface.KinesisAPI) Option {
	return func(c *Consumer) {
		c.client = client
	}
}
324216
func Client(timeout time.Duration) *http.Client {
	transport := http.Transport{
		Dial: func(network string, addr string) (net.Conn, error) {
			conn, err := net.DialTimeout(network, addr, timeout)
			if err != nil {
				golog.Debugf("%v", err)
				return nil, err
			}
			return conn, err
		},
	}

	client := &http.Client{
		Transport: &transport,
	}

	return client
}
1363958
func Client(conn net.Conn, config *Config) *Conn {
	return NewConn(conn, config, true)
}
1292785
func Client(c client.Client) registry.Option {
	return func(o *registry.Options) {
		opts := getOptions(o.Context)
		opts.Client = c
		o.Context = setOptions(o.Context, opts)
	}
}
260976
func (b *Backend) getClient() *gomemcache.Client {
	if b.client == nil {
		b.client = gomemcache.New(b.servers...)
	}
	return b.client
}
1111977
func NewClient(opts ...ClientOpt) *Client {
	c := &Client{
		run:          run,
		declarations: make([]Declaration, 0),
		consumers:    make(map[*Consumer]struct{}),
		publishers:   make(map[*Publisher]struct{}),
		errs:         make(chan error, 100),
		blocking:     make(chan amqp.Blocking, 10),
	}

	for _, o := range opts {
		o(c)
	}
	return c
}
581481
func Client(endpoint, secret string, skipverify bool) Plugin {
	client := client.New(endpoint, secret, skipverify)
	client.Accept = V1
	return &pluginClient{
		client: client,
	}
}
233431
func Client(only bool) Option {
	return func(o *Options) error {
		o.Client = only
		return nil
	}
}
409127
func NewClient(cfg *config.Config) *Client {
	rt := &apiRoundTripper{
		DefaultRequestDoer: registry.DefaultRequestDoer{
			Client: &http.Client{
				Transport: newTransport(cfg),

				// The client can trust the daemon to do the right thing and
				// cancel appropriately. Therefore, we only care about a
				// connection timeout, not a request timeout.
				Timeout: 0,
			},
			Host: "http://localhost",
		},
	}

	c := &Client{Client: *registry.NewClientWithRoundTripper(rt)}

	c.Users = newUsersClient(c.Client.Users, rt)
	c.Machines = newMachinesClient(c.Client.Machines, rt)
	c.KeyPairs = newKeyPairsClient(c.Client.KeyPairs, rt)
	c.OrgInvites = newOrgInvitesClient(c.Client.OrgInvites, rt)
	c.Version = newVersionClient(c.Client.Version, rt)

	c.Session = &SessionClient{client: rt}
	c.Credentials = &CredentialsClient{client: rt}
	c.Worklog = &WorklogClient{client: rt}
	c.Updates = &UpdatesClient{client: rt}

	return c
}
618625
func getMetadata(c context.Context) *metadata.Client {
	return c.Value(&metaKey).(*metadata.Client)
}
61092
func (c *Context) GetClient() kv.Client {
	if c.Store == nil {
		return nil
	}
	return c.Store.GetClient()
}