// withClient installs an RPC client pointer into the given context.
// It can be retrieved later on with getClient.
547991
func withClient(c context.Context, client crimson.CrimsonClient) context.Context {
	return context.WithValue(c, &clientKey, client)
}
1069828
func WithContext(ctx context.Context) func(*Client) error {
	return func(c *Client) error {
		c.Ctx = ctx
		return nil
	}
}
511307
func (cl *Listener) AddClient(alpn string, client Client) {
	cl.l.Lock()
	cl.clients[alpn] = client
	cl.l.Unlock()
}
1341192
func WithHttpClient(c *http.Client) Option {
	return func(s *Settings) error {
		if c == nil {
			return errInvalidHttpClient
		}
		s.client = c
		return nil
	}
}
255023
func (p *Plugin) Client() *plugins.Client {
	p.mu.RLock()
	defer p.mu.RUnlock()

	return p.pClient
}
287681
func (o *FlushInactiveOAuth2TokensParams) WithHTTPClient(client *http.Client) *FlushInactiveOAuth2TokensParams {
	o.SetHTTPClient(client)
	return o
}
1361364
func WithClient(client kinesisiface.KinesisAPI) Option {
	return func(c *Consumer) {
		c.client = client
	}
}
1000236
func (client *BaseClient) GetClientContext(
	settings *InvokeSettings) (context *ClientContext) {
	context = client.contextPool.Get().(*ClientContext)
	context.InitBaseContext()
	context.Client = client
	context.Retried = 0
	if client.UserData != nil {
		for k, v := range client.UserData {
			context.SetInterface(k, v)
		}
	}
	if settings == nil {
		context.InvokeSettings = InvokeSettings{
			Timeout: client.timeout,
			Retry:   client.retry,
		}
	} else {
		if settings.userData != nil {
			for k, v := range settings.userData {
				context.SetInterface(k, v)
			}
		}
		context.InvokeSettings = *settings
		if settings.Timeout <= 0 {
			context.Timeout = client.timeout
		}
		if settings.Retry <= 0 {
			context.Retry = client.retry
		}
	}
	return context
}
903798
func (o *CreateOAuth2ClientParams) WithHTTPClient(client *http.Client) *CreateOAuth2ClientParams {
	o.SetHTTPClient(client)
	return o
}
1282019
func WithClient(a adaptor.Adaptor) OptionFunc {
	return func(n *Node) error {
		cli, err := a.Client()
		n.c = cli
		return err
	}
}
406688
func WithClient(client *http.Client) DevToolsOption {
	return func(d *DevTools) {
		d.client = client
	}
}
701199
func WithHTTPClient(client *http.Client) Opt {
	return func(c *Client) error {
		if client != nil {
			c.client = client
		}
		return nil
	}
}
904414
func NewClientConnWithContext(ctx context.Context, addr string, opts ...grpc.DialOption) *grpc.ClientConn {
	opts = append(opts, grpc.WithWriteBufferSize(128*1024))
	opts = append(opts, grpc.WithReadBufferSize(128*1024))
	conn, err := grpc.DialContext(ctx, addr, opts...)
	if err != nil {
		grpclog.Fatalf("NewClientConn(%q) failed to create a ClientConn %v", addr, err)
	}
	return conn
}
975795
func WithClientMiddleware(middlewares ...Middleware) ClientOption {
	return func(opts *clientOptions) {
		opts.middlewares = append(opts.middlewares, middlewares...)
	}
}
896076
func (o *GetOAuth2ClientParams) WithContext(ctx context.Context) *GetOAuth2ClientParams {
	o.SetContext(ctx)
	return o
}
1027855
func (s *witServiceImpl) createClientWithContextSigner(ctx context.Context) (*witservice.Client, error) {
	c, err := s.createClient()
	if err != nil {
		return nil, err
	}
	sgn := signer.NewSATokenSigner(ctx)
	saTokenSigner, err := sgn.Signer()
	if err != nil {
		return nil, err
	}
	c.SetJWTSigner(saTokenSigner)
	return c, nil
}
849456
func (o *GetOAuth2ClientParams) WithHTTPClient(client *http.Client) *GetOAuth2ClientParams {
	o.SetHTTPClient(client)
	return o
}