summaryrefslogtreecommitdiff
path: root/Hutch/Models/Paste.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Hutch/Models/Paste.swift')
-rw-r--r--Hutch/Models/Paste.swift29
1 files changed, 29 insertions, 0 deletions
diff --git a/Hutch/Models/Paste.swift b/Hutch/Models/Paste.swift
new file mode 100644
index 0000000..b4c8f18
--- /dev/null
+++ b/Hutch/Models/Paste.swift
@@ -0,0 +1,29 @@
+import Foundation
+
+struct PasteFile: Codable, Sendable, Hashable, Identifiable {
+ let filename: String?
+ let hash: String
+ let contents: URL?
+
+ var id: String { hash }
+}
+
+struct Paste: Codable, Sendable, Identifiable, Hashable {
+ let id: String
+ let created: Date
+ let visibility: Visibility
+ let files: [PasteFile]
+ let user: Entity
+}
+
+struct PasteUploadDraft: Identifiable, Equatable, Sendable {
+ let id: UUID
+ var filename: String
+ var contents: String
+
+ init(id: UUID = UUID(), filename: String = "", contents: String = "") {
+ self.id = id
+ self.filename = filename
+ self.contents = contents
+ }
+}