24 lines
490 B
Swift
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
|
|
}
|
|
}
|