// WithQueryTTL is used to configure a context that will set the TTL of a query request,
969924
func WithQueryTTL(parent context.Context, value time.Duration) context.Context {
	return context.WithValue(contextOrBackground(parent), keyQueryTTL, value)
}
1026935
func (_ENS *ENSSession) Ttl(node [32]byte) (uint64, error) {
	return _ENS.Contract.Ttl(&_ENS.CallOpts, node)
}
1013683
func (qc *QueryContext) WithPackage(pkg *Package) *QueryContext {
	if qc == nil {
		qc = NewQueryContext()
	}
	qc.Package = pkg
	return qc
}
226044
func (cache *Cache) TTL(key []byte) (timeLeft uint32, err error) {
	hashVal := hashFunc(key)
	segID := hashVal & segmentAndOpVal
	cache.locks[segID].Lock()
	timeLeft, err = cache.segments[segID].ttl(key, hashVal)
	cache.locks[segID].Unlock()
	return
}
636728
func (builder *SearchCommandBuilder) WithQuery(query string) *SearchCommandBuilder {
	builder.protobuf.Q = []byte(query)
	return builder
}
589772
func (q *Query) WithTransaction(txn storage.Transaction) *Query {
	q.txn = txn
	return q
}
35288
func (r *GithubAuthRequest) SetTTL(clock clockwork.Clock, ttl time.Duration) {
	expireTime := clock.Now().UTC().Add(ttl)
	r.Expires = &expireTime
}
934702
func QueryWithOptions(host string, opt QueryOptions) (*Response, error) {
	m, now, err := getTime(host, opt)
	if err != nil {
		return nil, err
	}
	return parseTime(m, now), nil
}
279621
func (q *Query) WithContext(ctx context.Context) *Query {
	q.ctx = ctx
	return q
}
174061
func (pool *Pool) TTL(ttl time.Duration) *Pool {
	pool.conf.TTL = ttl
	return &Pool{redis: pool.redis, conf: pool.conf}
}
118288
func WithQueryParameters(queryParameters map[string]interface{}) PrepareDecorator {
	parameters := ensureValueStrings(queryParameters)
	return func(p Preparer) Preparer {
		return PreparerFunc(func(r *http.Request) (*http.Request, error) {
			r, err := p.Prepare(r)
			if err == nil {
				if r.URL == nil {
					return r, NewError("autorest", "WithQueryParameters", "Invoked with a nil URL")
				}

				v := r.URL.Query()
				for key, value := range parameters {
					d, err := url.QueryUnescape(value)
					if err != nil {
						return r, err
					}
					v.Add(key, d)
				}
				r.URL.RawQuery = v.Encode()
			}
			return r, err
		})
	}
}
481585
func WithTLSClientConfig(c *tls.Config) DialOption {
	return func(o *dialOptions) {
		o.wsDialer.TLSClientConfig = c
	}
}
408344
func (c *Cache) setTTL(r services.Resource) {
	if c.OnlyRecent.Enabled || (c.PreferRecent.Enabled && c.PreferRecent.NeverExpires) {
		return
	}
	// honor expiry set in the resource
	if !r.Expiry().IsZero() {
		return
	}
	// set max TTL on the resources
	r.SetTTL(c.Clock, c.PreferRecent.MaxTTL)
}
1197418
func TTL(t time.Duration) func(Call) error {
	return func(o Call) error {
		m, ok := o.(*Mutate)
		if !ok {
			return errors.New("'TTL' option can only be used with mutation queries")
		}

		buf := make([]byte, 8)
		binary.BigEndian.PutUint64(buf, uint64(t.Nanoseconds()/1e6))
		m.ttl = buf

		return nil
	}
}
350210
func (c *LRUCache) AddWithTTL(key Key, value interface{}, TTL time.Duration) bool {
	expireAt := time.Now().UTC().Add(TTL)
	return c.addRecord(&cacheRecord{
		key:      key,
		value:    value,
		expireAt: &expireAt,
	})
}
290981
func (u *UserV2) SetTTL(clock clockwork.Clock, ttl time.Duration) {
	u.Metadata.SetTTL(clock, ttl)
}
612160
func SetTTL(duration time.Duration) Option {
	return func(m *MongoCache) {
		m.TTL = duration
	}
}