// DialContext is a convenience wrapper for DefaultDialer.DialContext.
320447
func DialContext(ctx context.Context, network string, address string) (*Conn, error) {
	return DefaultDialer.DialContext(ctx, network, address)
}
279565
func DialPipeContext(ctx context.Context, path string) (net.Conn, error) {
	var err error
	var h syscall.Handle
	h, err = tryDialPipe(ctx, &path)
	if err != nil {
		return nil, err
	}

	var flags uint32
	err = getNamedPipeInfo(h, &flags, nil, nil, nil)
	if err != nil {
		return nil, err
	}

	f, err := makeWin32File(h)
	if err != nil {
		syscall.Close(h)
		return nil, err
	}

	// If the pipe is in message mode, return a message byte pipe, which
	// supports CloseWrite().
	if flags&cPIPE_TYPE_MESSAGE != 0 {
		return &win32MessageBytePipe{
			win32Pipe: win32Pipe{win32File: f, path: path},
		}, nil
	}
	return &win32Pipe{win32File: f, path: path}, nil
}
812251
func (cb *Breaker) CallContext(ctx context.Context, circuit func() error, timeout time.Duration) error {
	var err error

	if !cb.Ready() {
		return ErrBreakerOpen
	}

	if timeout == 0 {
		err = circuit()
	} else {
		c := make(chan error, 1)
		go func() {
			c <- circuit()
			close(c)
		}()

		select {
		case e := <-c:
			err = e
		case <-cb.Clock.After(timeout):
			err = ErrBreakerTimeout
		}
	}

	if err != nil {
		if ctx.Err() != context.Canceled {
			cb.Fail()
		}
		return err
	}

	cb.Success()
	return nil
}
58729
func (p *Provider) DialContext(
	ctx context.Context,
	network, address string) (net.Conn, error) {

	switch p.mapNetwork(network) {
	case networkMemb, networkMemu:
		return p.DialMemContext(
			ctx, network, nil, &Addr{
				Name:    address,
				network: network,
			})
	default:
		if ctx == nil {
			return net.Dial(network, address)
		}
		return (&net.Dialer{}).DialContext(ctx, network, address)
	}
}
172861
func DialContext(ctx context.Context, rawurl string) (*Client, error) {
	u, err := url.Parse(rawurl)
	if err != nil {
		return nil, err
	}
	switch u.Scheme {
	case "http", "https":
		return DialHTTP(rawurl)
	case "ws", "wss":
		return DialWebsocket(ctx, rawurl, "")
	case "stdio":
		return DialStdIO(ctx)
	case "":
		return DialIPC(ctx, rawurl)
	default:
		return nil, fmt.Errorf("no known transport for URL scheme %q", u.Scheme)
	}
}
825770
func (d *Dialer) Dial(network, address string) (net.Conn, error) {
	return d.DialContext(context.Background(), network, address)
}
1197534
func (call *GetMessageQuotaCall) WithContext(ctx context.Context) *GetMessageQuotaCall {
	call.ctx = ctx
	return call
}
808853
func FromContext(ctx context.Context) (CallInfo, bool) {
	ci, ok := ctx.Value(callInfoKey).(CallInfo)
	return ci, ok
}
560340
func (c *AckCall) Context(ctx context.Context) *AckCall {
	c.ctx_ = ctx
	return c
}
553502
func (n *Network) ContextDialer(d ContextDialer) ContextDialer {
	return func(ctx context.Context, network, address string) (net.Conn, error) {
		conn, err := d(ctx, network, address)
		if err != nil {
			return nil, err
		}
		return n.Conn(conn)
	}
}
1142667
func (r *resolver) dial(ctx context.Context, network, _ string) (net.Conn, error) {
	return r.dialer.DialContext(ctx, network, r.address())
}
1204622
func NewContext(ctx context.Context, ef *vtrpcpb.CallerID, im *querypb.VTGateCallerID) context.Context {
	ctx = context.WithValue(
		context.WithValue(ctx, effectiveCallerIDKey, ef),
		immediateCallerIDKey,
		im,
	)
	return ctx
}
1276614
func (c *CancelBatchCall) Context(ctx context.Context) *CancelBatchCall {
	c.ctx_ = ctx
	return c
}
289008
func DialWithContext(ctx context.Context) DialOption {
	return DialOption{func(do *dialOptions) {
		do.context = ctx
	}}
}
281978
func (call *GetRichMenuListCall) WithContext(ctx context.Context) *GetRichMenuListCall {
	call.ctx = ctx
	return call
}
1179577
func DialContext(ctx context.Context, network string, addr string) (net.Conn, error) {
	return dial.Load().(func(context.Context, string, string) (net.Conn, error))(ctx, network, addr)
}
1255966
func (cc *CachingConnector) DialContext(ctx context.Context, target string, opts ...grpc.DialOption) (*grpc.ClientConn, error) {
	logger.Debugf("DialContext: %s", target)

	cc.lock.Lock()
	c, ok := cc.loadConn(target)
	if !ok {
		createdConn, err := cc.createConn(ctx, target, opts...)
		if err != nil {
			cc.lock.Unlock()
			return nil, errors.WithMessage(err, "connection creation failed")
		}
		c = createdConn
	}

	cc.lock.Unlock()

	if err := cc.openConn(ctx, c); err != nil {
		cc.lock.Lock()
		setClosed(c)
		cc.lock.Unlock()
		return nil, errors.Errorf("dialing connection timed out [%s]", target)
	}
	return c.conn, nil
}