mirror of
https://github.com/yggdrasil-network/yggdrasil-ios.git
synced 2025-04-28 22:25:10 +03:00
App updates
This commit is contained in:
parent
2cb5eebcd2
commit
5fbb735f56
9 changed files with 204 additions and 91 deletions
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue