mirror of
https://github.com/metabolist/metatext.git
synced 2024-05-18 16:28:21 +00:00
35 lines
1.1 KiB
Swift
35 lines
1.1 KiB
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import Foundation
|
|
import HTTP
|
|
import Mastodon
|
|
|
|
public struct AppEnvironment {
|
|
let session: Session
|
|
let webAuthSessionType: WebAuthSession.Type
|
|
let keychainServiceType: KeychainService.Type
|
|
let userDefaults: UserDefaults
|
|
let inMemoryContent: Bool
|
|
|
|
public init(session: Session,
|
|
webAuthSessionType: WebAuthSession.Type,
|
|
keychainServiceType: KeychainService.Type,
|
|
userDefaults: UserDefaults,
|
|
inMemoryContent: Bool) {
|
|
self.session = session
|
|
self.webAuthSessionType = webAuthSessionType
|
|
self.keychainServiceType = keychainServiceType
|
|
self.userDefaults = userDefaults
|
|
self.inMemoryContent = inMemoryContent
|
|
}
|
|
}
|
|
|
|
public extension AppEnvironment {
|
|
static let live: Self = Self(
|
|
session: Session(configuration: .default),
|
|
webAuthSessionType: LiveWebAuthSession.self,
|
|
keychainServiceType: LiveKeychainService.self,
|
|
userDefaults: .standard,
|
|
inMemoryContent: false)
|
|
}
|