27 lines
693 B
Swift
27 lines
693 B
Swift
import Hummingbird
|
|
import Infrastructure
|
|
|
|
/// A ``LocalizedRequestContext`` carrying the core storage and the negotiated language only.
|
|
struct StubRequestContext: LocalizedRequestContext {
|
|
|
|
// MARK: Properties
|
|
|
|
/// The core request context storage Hummingbird requires.
|
|
var coreContext: CoreRequestContextStorage
|
|
|
|
/// The language identifier negotiated for the request.
|
|
var language: String
|
|
|
|
// MARK: Initializers
|
|
|
|
/// Creates a request context for the given source.
|
|
/// - Parameter source: the source the context is initialized from.
|
|
init(
|
|
source: Source
|
|
) {
|
|
self.coreContext = .init(source: source)
|
|
self.language = ""
|
|
}
|
|
|
|
}
|