Skip to content

Instantly share code, notes, and snippets.

@emenegro
Last active March 21, 2017 21:04
Show Gist options
  • Save emenegro/1923ca5797ce45ebc4f903da9061b405 to your computer and use it in GitHub Desktop.
Save emenegro/1923ca5797ce45ebc4f903da9061b405 to your computer and use it in GitHub Desktop.
protocol BuildStep {
func build() -> OfflineAction
}
protocol RequestStep {
func toCache(_ request: OfflineRequestConvertible) -> DataStep
func toGet(_ request: OfflineRequestConvertible) -> GetCommonsStep
func toDelete(_ request: OfflineRequestConvertible) -> CommonsStep
}
protocol DataStep {
func data(_ data: Data) -> CacheCommonsStep
}
protocol CommonsStep: BuildStep {
func forId(_ id: String) -> Self
func withEncryptionKey(_ encryptionKey: String) -> Self
}
protocol CacheCommonsStep: CommonsStep {
func keepingAliveUntil(_ date: Date) -> Self
}
protocol GetCommonsStep: CommonsStep {
func ifBefore(_ date: Date) -> Self
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment