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

19 lines
442 B
Go

package utils
type DBObject interface {
GenerateID()
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, error)
DeleteOne(id string) (DBObject, error)
StoreOne(data DBObject) (DBObject, error)
UpdateOne(set map[string]interface{}, id string) (DBObject, error)
}