// Timeout is the time each individual bulk request should wait for shards
// that are unavailable.
504588
func (s *UpdateByQueryService) Timeout(timeout string) *UpdateByQueryService {
	s.timeout = timeout
	return s
}
917765
func (s *IndicesPutMappingService) Timeout(timeout string) *IndicesPutMappingService {
	s.timeout = timeout
	return s
}
685915
func (s *IndicesCloseService) MasterTimeout(masterTimeout string) *IndicesCloseService {
	s.masterTimeout = masterTimeout
	return s
}
1102200
func (s *IngestPutPipelineService) Timeout(timeout string) *IngestPutPipelineService {
	s.timeout = timeout
	return s
}
1294698
func (s *IndexService) Timeout(timeout string) *IndexService {
	s.timeout = timeout
	return s
}
521227
func (s *NodesStatsService) Timeout(timeout string) *NodesStatsService {
	s.timeout = timeout
	return s
}
198931
func (s *ReindexService) Timeout(timeout string) *ReindexService {
	s.timeout = timeout
	return s
}
535685
func (s *IndicesFreezeService) MasterTimeout(masterTimeout string) *IndicesFreezeService {
	s.masterTimeout = masterTimeout
	return s
}
964679
func Timeout(t time.Duration) metaOp {
	return func(c *Client) {
		c.http.Timeout = t
	}
}
249086
func (s *IndicesCreateService) MasterTimeout(masterTimeout string) *IndicesCreateService {
	s.masterTimeout = masterTimeout
	return s
}
1249125
func (s *PutScriptService) Timeout(timeout string) *PutScriptService {
	s.timeout = timeout
	return s
}
558850
func Timeout(d time.Duration) ConfigOpt {
	return func(c *Config) {
		c.transport.ResponseHeaderTimeout = d
		c.transport.TLSHandshakeTimeout = d
		c.dialer.Timeout = d
	}
}
534312
func Timeout(d time.Duration) func(*Attacker) {
	return func(a *Attacker) {
		a.client.Timeout = d
	}
}
1102664
func (s *SnapshotGetService) MasterTimeout(masterTimeout string) *SnapshotGetService {
	s.masterTimeout = masterTimeout
	return s
}
854844
func (r *Request) Timeout(d time.Duration) *Request {
	if r.err != nil {
		return r
	}
	r.timeout = d
	return r
}
1343754
func (nc *Conn) FlushTimeout(timeout time.Duration) (err error) {
	if nc == nil {
		return ErrInvalidConnection
	}
	if timeout <= 0 {
		return ErrBadTimeout
	}

	nc.mu.Lock()
	if nc.isClosed() {
		nc.mu.Unlock()
		return ErrConnectionClosed
	}
	t := globalTimerPool.Get(timeout)
	defer globalTimerPool.Put(t)

	// Create a buffered channel to prevent chan send to block
	// in processPong() if this code here times out just when
	// PONG was received.
	ch := make(chan struct{}, 1)
	nc.sendPing(ch)
	nc.mu.Unlock()

	select {
	case _, ok := <-ch:
		if !ok {
			err = ErrConnectionClosed
		} else {
			close(ch)
		}
	case <-t.C:
		err = ErrTimeout
	}

	if err != nil {
		nc.removeFlushEntry(ch)
	}
	return
}
64871
func Timeout(timeout time.Duration) func(*Client) error {
	return func(c *Client) error {
		c.timeout = timeout
		return nil
	}
}