summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-04-06 20:56:49 +0200
committerxengineering <me@xengineering.eu>2024-04-07 10:26:20 +0200
commit537bbcea3b2477eeae7d86422a073558185cf4eb (patch)
tree8ed9d24a34fad9f02a0ede5f9ed8d5f11b96a356
parent4aee2c3b45caa890537a0fc0c850c4523a4eb56c (diff)
downloadceres-537bbcea3b2477eeae7d86422a073558185cf4eb.tar
ceres-537bbcea3b2477eeae7d86422a073558185cf4eb.tar.zst
ceres-537bbcea3b2477eeae7d86422a073558185cf4eb.zip
model: Add model.Object interface
This interface will allow to implement generic functions based on the Object interface which covers the four CRUD methods create, read, update and delete. This should be possible for every object handled by the server.
-rw-r--r--model/object.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/model/object.go b/model/object.go
new file mode 100644
index 0000000..63ef419
--- /dev/null
+++ b/model/object.go
@@ -0,0 +1,12 @@
+package model
+
+import (
+ "database/sql"
+)
+
+type Object interface {
+ Create(tx *sql.Tx) error
+ Read(tx *sql.Tx) error
+ Update(tx *sql.Tx) error
+ Delete(tx *sql.Tx) error
+}