App updates

This commit is contained in:
Neil Alexander 2024-04-16 21:35:51 +01:00
parent 2cb5eebcd2
commit 5fbb735f56
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
9 changed files with 204 additions and 91 deletions

View file

@ -11,11 +11,29 @@ struct YggdrasilSummary: Codable {
var address: String
var subnet: String
var publicKey: String
var enabled: Bool
var peers: [YggdrasilPeer]
func list() -> [String] {
return peers.map { $0.remote }
}
}
struct YggdrasilStatus: Codable {
var enabled: Bool
var coords: String
var peers: Data
var dht: Data
struct YggdrasilPeer: Codable, Identifiable {
var id: String { remote } // For Identifiable protocol
let remote: String
let up: Bool
let address: String
let key: String
let priority: UInt8
let cost: UInt16?
enum CodingKeys: String, CodingKey {
case remote = "URI"
case up = "Up"
case address = "IP"
case key = "Key"
case priority = "Priority"
case cost = "Cost"
}
}