Instance Method
getInfo(_:)
Issue a multi-key GETINFO command (control-spec.txt §3.9).
func getInfo(_ keys: [String]) async throws -> [String : String]
Parameters
-
keys
-
Info keys to query (e.g. ["version", "status/bootstrap-phase", "net/listeners/socks"]).
Return Value
Dictionary mapping each requested key to its returned value. Missing keys are omitted (Tor responds with an error reply in that case).
Mentioned In
Discussion
Joins keys with spaces and sends GETINFO k1 k2 …. Tor replies with one 250-key=value line per key; the response is parsed into a dictionary by parseGetInfoResponse(_:).
Throws
TorError.controlProtocolError(code:message:) for non-success replies (e.g. 552 “unrecognized key”), or TorError.invalidResponse(_:) on malformed output.
Note
For the full GETINFO key vocabulary see control-spec.txt §3.9. swift-tor uses version, net/listeners/socks, and status/bootstrap-phase most frequently.