From 537bbcea3b2477eeae7d86422a073558185cf4eb Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 6 Apr 2024 20:56:49 +0200 Subject: 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. --- model/object.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 model/object.go 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 +} -- cgit v1.2.3-70-g09d2