// ExpireAt returns the expiration date
330374
func (d *AuthorizeData) ExpireAt() time.Time {
	return d.CreatedAt.Add(time.Duration(d.ExpiresIn) * time.Second)
}
1181952
func (p *MemcacheProvider) Init(expire int64, connStrs string) error {
	p.expire = int32(expire)
	p.c = memcache.New(strings.Split(connStrs, ";")...)
	return nil
}
958303
func (t *Token) expired() bool {
	if t.Expiry.IsZero() {
		return false
	}
	return t.Expiry.Add(-expiryDelta).Before(time.Now())
}
1053368
func (s *ProposalSummary) SetExpirationDate(v time.Time) *ProposalSummary {
	s.ExpirationDate = &v
	return s
}
64325
func ExpiresAt(identityBytes []byte) time.Time {
	sId := &msp.SerializedIdentity{}
	// If protobuf parsing failed, we make no decisions about the expiration time
	if err := proto.Unmarshal(identityBytes, sId); err != nil {
		return time.Time{}
	}
	bl, _ := pem.Decode(sId.IdBytes)
	if bl == nil {
		// If the identity isn't a PEM block, we make no decisions about the expiration time
		return time.Time{}
	}
	cert, err := x509.ParseCertificate(bl.Bytes)
	if err != nil {
		return time.Time{}
	}
	return cert.NotAfter
}
118738
func (c *Cache) cleanExpired() {
	for {
		c.Lock()
		if c.ttlIdx.Len() == 0 {
			c.Unlock()
			time.Sleep(c.ttl)
			continue
		}
		ci := c.ttlIdx.Back().Value.(*cachedItem)
		now := time.Now()
		if now.Before(ci.expiryTime) {
			c.Unlock()
			time.Sleep(ci.expiryTime.Sub(now))
			continue
		}
		c.remove(ci.itemID)
		c.Unlock()
	}
}
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
}
1210987
func MustEnsureIndexExpireAt() Option {
	return func(m *MongoCache) {
		if err := m.EnsureIndex(); err != nil {
			panic(fmt.Sprintf("index must ensure %q", err))
		}
	}
}
269924
func (r *Redis) PExpireAt(key string, timestamp int64) (bool, error) {
	rp, err := r.ExecuteCommand("PEXPIREAT", key, timestamp)
	if err != nil {
		return false, err
	}
	return rp.BoolValue()
}
230774
func (v *Validator) SetExpiration(exp time.Time) {
	v.expect()
	v.Expected.Set("exp", exp)
}
709160
func (s *streamImpl) expireTime() (t time.Time, has bool) {
	s.withParserLock(func() error {
		t, has = s.c.parser.firstChunkTime()
		return nil
	})

	if has {
		t = t.Add(s.c.maximumBufferDuration)
	}
	return
}
619727
func IsExpired(d Dated) bool {
	if d.ExpiryDate().IsZero() {
		return false
	}
	return d.ExpiryDate().Before(time.Now())
}
255944
func (c *cookie) Expire(w http.ResponseWriter) {
	// to expire cookie set the time in the past
	cookie := http.Cookie{
		Name:     DefaultCookieName,
		Value:    "none",
		HttpOnly: true,
		Path:     "/",
		Expires:  c.Now().Add(-1 * time.Hour),
	}

	http.SetCookie(w, &cookie)
}
817022
func (dbi *dbItem) expired() bool {
	return dbi.opts != nil && dbi.opts.ex && time.Now().After(dbi.opts.exat)
}
164588
func (i *Item) Init() {
	i.CreatedAt = time.Now().UnixNano()
	i.ExpiredAt = math.MaxInt64
	i.Value = nil
}
860395
func (c *Certificate) SetExpireDate(when time.Duration) error {
	offset := C.long(when / time.Second)
	result := C.X509_gmtime_adj(C.X_X509_get0_notAfter(c.x), offset)
	if result == nil {
		return errors.New("failed to set expire date")
	}
	return nil
}
274777
func (s *CreateCloudFormationTemplateOutput) SetExpirationTime(v string) *CreateCloudFormationTemplateOutput {
	s.ExpirationTime = &v
	return s
}