Skip to content

Commit

Permalink
chore: add comments for expirer
Browse files Browse the repository at this point in the history
refactor: remove unnecessary ExpiryKeeper
  • Loading branch information
redbirdztc committed Mar 22, 2024
1 parent b082d73 commit b822358
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions expirer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import (
"time"

Check failure on line 5 in expirer.go

View workflow job for this annotation

GitHub Actions / build

"time" imported and not used
)

// Expirer is an interface that defines the IsExpired method.
// Types that implement this interface can be checked for expiration.
type Expirer interface {
IsExpired() bool
}

type ExpiryKeeper interface {
TimeoutAt(time.Time)
Timeout() time.Time
}

// HasExpiredData checks if the given value or any of its nested values are expired.
// It recursively traverses through arrays, slices, structs, and maps to check for expiration.
// If the value is nil or not expirable, it returns false.
func HasExpiredData(v any) bool {
if v == nil {
return false
Expand Down

0 comments on commit b822358

Please sign in to comment.