mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 02:17:05 +00:00
Sessions are now in full sync with the registered database, on acquire(init), set, get, delete, clear, visit, len, release(destroy) as requested by almost everyone. https://github.com/kataras/iris/issues/969
Former-commit-id: 49fcdb93106a78f0a24ad3fb4d8725e35e98451a
This commit is contained in:
@@ -63,3 +63,9 @@ func (lt *LifeTime) HasExpired() bool {
|
||||
|
||||
return lt.Time.Before(time.Now())
|
||||
}
|
||||
|
||||
// DurationUntilExpiration returns the duration until expires, it can return negative number if expired,
|
||||
// a call to `HasExpired` may be useful before calling this `Dur` function.
|
||||
func (lt *LifeTime) DurationUntilExpiration() time.Duration {
|
||||
return time.Until(lt.Time)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user