Caps-Train/Sources/Configuration.swift
2023-10-23 14:58:58 +02:00

24 lines
490 B
Swift

import Foundation
struct Configuration {
let contentFolder: String
let trainingIterations: Int
let serverPath: String
let authenticationToken: String
}
extension Configuration {
func serverUrl() throws -> URL {
guard let serverUrl = URL(string: serverPath) else {
print("[ERROR] Configuration: Invalid server path \(serverPath)")
throw TrainingError.invalidServerPath
}
return serverUrl
}
}