// Expires returns the time.Time when the Token expires.
541191
func (t Token) Expires() time.Time {
	s, err := t.ExpiresOn.Float64()
	if err != nil {
		s = -3600
	}

	expiration := date.NewUnixTimeFromSeconds(s)

	return time.Time(expiration).UTC()
}
1180097
func (t *TombstoneGC) nextExpires() time.Time {
	// The Round(0) call here is to shed the monotonic time so that we
	// can safely use these as map keys. See #3670 for more details.
	expires := time.Now().Add(t.ttl).Round(0)
	remain := expires.UnixNano() % int64(t.granularity)
	adj := expires.Add(t.granularity - time.Duration(remain))
	return adj
}
1174278
func (e *Expiry) IsExpired() bool {
	curTime := e.CurrentTime
	if curTime == nil {
		curTime = time.Now
	}
	return e.expiration.Before(curTime())
}
1157245
func (l *LeaseOptions) ExpirationTime() time.Time {
	var expireTime time.Time
	if l.LeaseEnabled() {
		expireTime = time.Now().Add(l.LeaseTotal())
	}
	return expireTime
}
319095
func (p *PostPolicy) SetExpires(t time.Time) error {
	if t.IsZero() {
		return ErrInvalidArgument("No expiry time set.")
	}
	p.expiration = t
	return nil
}
1031595
func (t *token) Expired() bool {
	if t == nil {
		return true
	}
	return !t.Token.Valid()
}
619513
func (s Share) IsExpired() bool {
	t := time.Time(s.b.ss.Expires)
	return !t.IsZero() && clockNow().After(t)
}
785648
func (a *SetCookieArgs) SetExpires(expires TimeSinceEpoch) *SetCookieArgs {
	a.Expires = expires
	return a
}
58768
func (cred Credentials) IsExpired() bool {
	if cred.Expiration.IsZero() || cred.Expiration == timeSentinel {
		return false
	}

	return cred.Expiration.Before(time.Now().UTC())
}
433990
func (b *Backend) setExpirationTime(key string) error {
	expiresIn := b.GetConfig().ResultsExpireIn
	if expiresIn == 0 {
		// // expire results after 1 hour by default
		expiresIn = config.DefaultResultsExpireIn
	}
	expirationTimestamp := int32(time.Now().Unix() + int64(expiresIn))

	conn := b.open()
	defer conn.Close()

	_, err := conn.Do("EXPIREAT", key, expirationTimestamp)
	if err != nil {
		return err
	}

	return nil
}
98871
func OptionTokenExpire(t time.Duration) OptionRoundtripperFunc {
	return func(j *dcosRoundtripper) error {
		if t < 1 {
			return ErrInvalidExpireDuration
		}
		j.expire = t
		return nil
	}
}
142818
func WithExpires(expires time.Time) MarshalOption {
	return func(c *MarshalConfig) error {
		c.Expires = expires
		return nil
	}
}
945786
func (s *Session) Expired() error {
	if time.Now().After(s.ExpiresAt) {
		return fmt.Errorf(ErrSessionExpired)
	}

	return nil
}
1303971
func (c *Client) Expire(key string, seconds int) (bool, error) {
	v, err := c.execWithKey(true, "EXPIRE", key, seconds)
	if err != nil {
		return false, err
	}
	return iface2bool(v)
}
203371
func (t *Timetag) ExpiresIn() time.Duration {
	if t.timeTag <= 1 {
		return 0
	}

	tt := timetagToTime(t.timeTag)
	seconds := tt.Sub(time.Now())

	if seconds <= 0 {
		return 0
	}

	return seconds
}
665009
func (db *DB) Expire(key []byte, duration int64) (int64, error) {
	if duration <= 0 {
		return 0, errExpireValue
	}

	return db.setExpireAt(key, time.Now().Unix()+duration)
}
264605
func (t *TombstoneGC) expireTime(expires time.Time) {
	// This is careful to take the lock only while we are fetching the index
	// since the channel write might get blocked for reasons that could also
	// need to hint GC (see #3700).
	if index := t.purgeBin(expires); index > 0 {
		t.expireCh <- index
	}
}