Compare commits

...

1 Commits

Author SHA1 Message Date
Caleb Kleveter b430a6a50f
Conformed Storage class to ServiceType protocol. Marked Storage as final 2018-05-09 16:53:55 -05:00
1 changed files with 12 additions and 1 deletions

View File

@ -4,7 +4,18 @@ import Service
/// in a single request.
/// This type works with a request's `privateContainer`
/// to hold the data.
public class Storage: Service {
public final class Storage: Service, ServiceType {
/// Conforms `Storage` to `ServiceType`. This conformance
/// lets you register the `Storage` service using:
///
/// services.register(Storage.self)
///
/// - Parameter worker: The container that `Storage` instance
/// will be stored in.
public static func makeService(for worker: Container) throws -> Storage {
return Storage()
}
/// The underlying dictionary that holds everything.
public var cache: [String: Any?] = [:]