Shallow Get All

This commit is contained in:
mr
2024-07-23 11:22:50 +02:00
parent a687206a1b
commit 94cd62acfe
10 changed files with 119 additions and 14 deletions

View File

@@ -19,6 +19,10 @@ func (ao *AbstractObject) GetID() string {
return ao.UUID
}
func (ao *AbstractObject) GetName() string {
return ao.Name
}
func (r *AbstractObject) GenerateID() {
r.UUID = uuid.New().String()
}

View File

@@ -1,5 +1,11 @@
package utils
type ShallowDBObject interface {
GenerateID()
GetID() string
GetName() string
}
type DBObject interface {
GenerateID()
GetID() string
@@ -12,6 +18,7 @@ type DBObject interface {
type Accessor interface {
SetLogger(t DataType)
GetType() string
LoadAll() ([]ShallowDBObject, int, error)
LoadOne(id string) (DBObject, int, error)
DeleteOne(id string) (DBObject, int, error)
CopyOne(data DBObject) (DBObject, int, error)