Created
July 31, 2018 05:35
-
-
Save machuz/b3e316d81cdf63d927fd15c2b7304856 to your computer and use it in GitHub Desktop.
CacheIOのADT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed abstract class CacheIO[+A] {} | |
object CacheIO extends CacheIOCreation { | |
case class Put[T]( | |
key: CacheKey, | |
value: T, | |
expireSecond: Option[Long], | |
fmt: ByteStringFormatter[T] | |
) extends CacheIO[T] | |
case class PutList[T]( | |
key: CacheKey, | |
values: Seq[T], | |
expireSecond: Option[Long], | |
fmt: ByteStringFormatter[T] | |
) extends CacheIO[T] | |
case class Get[T]( | |
key: CacheKey, | |
fmt: ByteStringFormatter[T] | |
) extends CacheIO[Option[T]] | |
case class GetList[T]( | |
key: CacheKey, | |
fmt: ByteStringFormatter[T] | |
) extends CacheIO[Seq[T]] | |
case class Scan[T]( | |
matchGlob: Option[CacheKeyGlob], | |
fmt: ByteStringFormatter[T] | |
) extends CacheIO[Seq[T]] | |
case class ScanOne[T]( | |
matchGlob: CacheKeyGlob, | |
fmt: ByteStringFormatter[T] | |
) extends CacheIO[Option[T]] | |
case class Delete( | |
key: CacheKey | |
) extends CacheIO[Unit] | |
case class Has( | |
key: CacheKey | |
) extends CacheIO[Boolean] | |
case object Clear extends CacheIO[Unit] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment