oc-lib/models/utils/interfaces.go

21 lines
525 B
Go
Raw Normal View History

2024-07-18 11:51:12 +02:00
package utils
type DBObject interface {
2024-07-19 10:54:58 +02:00
GenerateID()
2024-07-19 13:27:34 +02:00
GetID() string
2024-07-18 11:51:12 +02:00
GetName() string
2024-07-18 14:39:54 +02:00
Deserialize(j map[string]interface{}) DBObject
2024-07-19 09:32:58 +02:00
Serialize() map[string]interface{}
2024-07-18 15:02:39 +02:00
GetAccessor() Accessor
2024-07-18 11:51:12 +02:00
}
type Accessor interface {
2024-07-19 10:54:58 +02:00
SetLogger(t DataType)
2024-07-18 16:46:54 +02:00
GetType() string
2024-07-19 11:27:58 +02:00
LoadOne(id string) (DBObject, int, error)
DeleteOne(id string) (DBObject, int, error)
2024-07-19 13:41:10 +02:00
CopyOne(data DBObject) (DBObject, int, error)
2024-07-19 11:27:58 +02:00
StoreOne(data DBObject) (DBObject, int, error)
UpdateOne(set map[string]interface{}, id string) (DBObject, int, error)
2024-07-18 11:51:12 +02:00
}