summaryrefslogtreecommitdiff
path: root/Hutch/Networking/SRHTService.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-03-19 15:18:38 -0500
committerChristian Cleberg <[email protected]>2026-03-19 15:18:38 -0500
commit659c76df9ff3926cb68886c16167808c23bd8f75 (patch)
tree572bef546fcca19ad37bc1aa7cfb153eb2bf8eb7 /Hutch/Networking/SRHTService.swift
parented48e72520c51e4635cd3840dbc569bdd74c950f (diff)
parent6ba4e967d5dfb5d3c7bb97a0f2662f3180595563 (diff)
downloadhutch-2.tar.gz
hutch-2.tar.bz2
hutch-2.zip
v2.0: Merge branch 'dev'v2
Diffstat (limited to 'Hutch/Networking/SRHTService.swift')
-rw-r--r--Hutch/Networking/SRHTService.swift11
1 files changed, 9 insertions, 2 deletions
diff --git a/Hutch/Networking/SRHTService.swift b/Hutch/Networking/SRHTService.swift
index 5db06dd..416b733 100644
--- a/Hutch/Networking/SRHTService.swift
+++ b/Hutch/Networking/SRHTService.swift
@@ -3,6 +3,7 @@ import Foundation
/// Each Sourcehut service exposes its own GraphQL endpoint.
enum SRHTService: String, Codable, Sendable, CaseIterable {
case meta
+ case hub
case git
case hg
case builds
@@ -14,13 +15,19 @@ enum SRHTService: String, Codable, Sendable, CaseIterable {
/// The GraphQL endpoint URL for this service.
var url: URL {
- // Force-unwrap is safe here — these are compile-time constant strings.
- URL(string: "https://\(rawValue).sr.ht/query")!
+ switch self {
+ case .hub:
+ URL(string: "https://sr.ht/query")!
+ default:
+ // Force-unwrap is safe here — these are compile-time constant strings.
+ URL(string: "https://\(rawValue).sr.ht/query")!
+ }
}
var displayName: String {
switch self {
case .meta: "Meta"
+ case .hub: "Hub"
case .git: "Git"
case .hg: "Mercurial"
case .builds: "Builds"