oc-lib/models/utils/interfaces.go
2024-07-19 13:41:10 +02:00

21 lines
525 B
Go

package utils
type DBObject interface {
GenerateID()
GetID() string
GetName() string
Deserialize(j map[string]interface{}) DBObject
Serialize() map[string]interface{}
GetAccessor() Accessor
}
type Accessor interface {
SetLogger(t DataType)
GetType() string
LoadOne(id string) (DBObject, int, error)
DeleteOne(id string) (DBObject, int, error)
CopyOne(data DBObject) (DBObject, int, error)
StoreOne(data DBObject) (DBObject, int, error)
UpdateOne(set map[string]interface{}, id string) (DBObject, int, error)
}