2024-07-18 11:51:12 +02:00
|
|
|
package utils
|
|
|
|
|
2024-07-18 16:46:54 +02:00
|
|
|
import "cloud.o-forge.io/core/oc-lib/models/resources"
|
|
|
|
|
2024-07-18 11:51:12 +02:00
|
|
|
type DBObject interface {
|
|
|
|
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-18 16:46:54 +02:00
|
|
|
SetLogger(t resources.ResourceType)
|
|
|
|
GetType() string
|
2024-07-18 15:35:30 +02:00
|
|
|
LoadOne(id string) (DBObject, error)
|
|
|
|
DeleteOne(id string) (DBObject, error)
|
|
|
|
StoreOne(data DBObject) (DBObject, error)
|
|
|
|
UpdateOne(set map[string]interface{}, id string) (DBObject, error)
|
2024-07-18 11:51:12 +02:00
|
|
|
}
|