//Expires 设置过期时间戳
961894
func (c *Cookie) Expires(p int) *Cookie {
	c.MaxAge(p)
	if p > 0 {
		c.cookie.Expires = time.Unix(time.Now().Unix()+int64(p), 0)
	} else if p < 0 {
		c.cookie.Expires = time.Unix(1, 0)
	}
	return c
}
765410
func (r *Redis) Expire(key string, seconds int) (bool, error) {
	rp, err := r.ExecuteCommand("EXPIRE", key, seconds)
	if err != nil {
		return false, err
	}
	return rp.BoolValue()
}
619513
func (s Share) IsExpired() bool {
	t := time.Time(s.b.ss.Expires)
	return !t.IsZero() && clockNow().After(t)
}
432922
func (s *Session) Expired() error {
	if time.Now().After(s.ExpiresAt) {
		return &Error{
			Code: EForbidden,
			Msg:  ErrSessionExpired,
		}
	}

	return nil
}
719719
func (m *Interactions) Expire(t time.Time) {
	m.mu.Lock()
	defer m.mu.Unlock()
	for id, item := range m.items {
		if item.done || item.expiry.After(t) {
			continue
		}
		delete(m.items, id)
		close(item.c)
	}
}
1013334
func (s *CreateStreamingURLOutput) SetExpires(v time.Time) *CreateStreamingURLOutput {
	s.Expires = &v
	return s
}
317987
func (reg *HostExpirationRegistry) IsExpired(hostid string) (bool, error) {
	reg.RLock()
	defer reg.RUnlock()
	expiration, ok := reg.registry[hostid]
	if !ok {
		// if it doesnt exist, I guess it's expired
		return true, ErrMissingHost
	}
	now := jwt.TimeFunc().Unix()
	return now >= expiration, nil
}
619727
func IsExpired(d Dated) bool {
	if d.ExpiryDate().IsZero() {
		return false
	}
	return d.ExpiryDate().Before(time.Now())
}
746605
func (c *Client) Expire(key string, seconds uint64) (bool, error) {
	var ret bool
	err := c.command(
		&ret,
		[]byte("EXPIRE"),
		[]byte(key),
		to.Bytes(seconds),
	)
	return ret, err
}
397076
func (c *Client) ExpireSession(ctx context.Context, key string) error {
	return c.db.Update(func(tx *bolt.Tx) error {
		s, err := c.findSession(ctx, tx, key)
		if err != nil {
			return err
		}

		s.ExpiresAt = time.Now()

		if err := c.putSession(ctx, tx, s); err != nil {
			return err
		}
		return nil
	})
}
1296980
func (e *Expiry) IsExpired() bool {
	if e.CurrentTime == nil {
		e.CurrentTime = time.Now
	}
	return e.expiration.Before(e.CurrentTime())
}
1238201
func (invoice *Invoice) Expiry() time.Duration {
	if invoice.expiry != nil {
		return *invoice.expiry
	}

	// If no expiry is set for this invoice, default is 3600 seconds.
	return 3600 * time.Second
}
873075
func (m *Metadata) Expiry() time.Time {
	if m.Expires == nil {
		return time.Time{}
	}
	return *m.Expires
}
230774
func (v *Validator) SetExpiration(exp time.Time) {
	v.expect()
	v.Expected.Set("exp", exp)
}
809447
func (whisper *Whisper) expire() {
	whisper.poolMu.Lock()
	defer whisper.poolMu.Unlock()

	whisper.statsMu.Lock()
	defer whisper.statsMu.Unlock()
	whisper.stats.reset()
	now := uint32(time.Now().Unix())
	for expiry, hashSet := range whisper.expirations {
		if expiry < now {
			// Dump all expired messages and remove timestamp
			hashSet.Each(func(v interface{}) bool {
				sz := whisper.envelopes[v.(common.Hash)].size()
				delete(whisper.envelopes, v.(common.Hash))
				whisper.stats.messagesCleared++
				whisper.stats.memoryCleared += sz
				whisper.stats.memoryUsed -= sz
				return false
			})
			whisper.expirations[expiry].Clear()
			delete(whisper.expirations, expiry)
		}
	}
}
1135839
func (counter Counter) Expired() bool {
	if counter.Expiration == 0 {
		return false
	}
	return time.Now().UnixNano() > counter.Expiration
}
58768
func (cred Credentials) IsExpired() bool {
	if cred.Expiration.IsZero() || cred.Expiration == timeSentinel {
		return false
	}

	return cred.Expiration.Before(time.Now().UTC())
}