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

19 lines
462 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, int, error)
DeleteOne(id string) (DBObject, int, error)
StoreOne(data DBObject) (DBObject, int, error)
UpdateOne(set map[string]interface{}, id string) (DBObject, int, error)
}