Skip to content

Instantly share code, notes, and snippets.

@boek
Created January 6, 2015 23:04
Show Gist options
  • Save boek/0fa8e14d08adeec5dba4 to your computer and use it in GitHub Desktop.
Save boek/0fa8e14d08adeec5dba4 to your computer and use it in GitHub Desktop.
protocol HTTPHandlerType {
typealias Data
/// :returns: true if the request was handled; false otherwise
func handle(request: HTTPRequest, data: Data) -> Bool
func foo(request: HTTPRequest, data: Data) -> Bool
}
class MyHandler : HTTPHandlerType {
func handle(request: HTTPRequest, data: Int) -> Bool {
return data > 5
}
func foo(request: HTTPRequest, data: String) -> Bool {
return data == ""
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment