Skip to content

Commit

Permalink
Make Age and Lifetime Private
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherDavenport committed Jun 24, 2020
1 parent b4690d7 commit 5707217
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ object CacheItem {
new CacheItem(date, expires, response)
)

final case class Age(val deltaSeconds: Long) extends AnyVal
object Age {
private[http4s] final case class Age(val deltaSeconds: Long) extends AnyVal
private[http4s] object Age {
def of(created: HttpDate, now: HttpDate): Age = new Age(now.epochSecond - created.epochSecond)
}
final case class CacheLifetime(val deltaSeconds: Long) extends AnyVal
object CacheLifetime {
private[http4s] final case class CacheLifetime(val deltaSeconds: Long) extends AnyVal
private[http4s] object CacheLifetime {
def of(expires: Option[HttpDate], now: HttpDate): Option[CacheLifetime] = expires.map{expiredAt =>
new CacheLifetime(expiredAt.epochSecond - now.epochSecond)
}
Expand Down

0 comments on commit 5707217

Please sign in to comment.