2015-09-28 04:17:12 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Determine if a file with expiry set to "ts" has expired yet
|
2015-10-06 08:50:20 +02:00
|
|
|
func isTsExpired(ts time.Time) bool {
|
|
|
|
now := time.Now()
|
|
|
|
return !ts.IsZero() && now.After(ts)
|
2015-09-28 04:17:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Determine if the given filename is expired
|
2015-09-28 06:25:57 +02:00
|
|
|
func isFileExpired(filename string) bool {
|
|
|
|
exp, _ := metadataGetExpiry(filename)
|
|
|
|
return isTsExpired(exp)
|
2015-09-28 04:17:12 +02:00
|
|
|
}
|