29 lines
691 B
Go
29 lines
691 B
Go
package utils
|
|
|
|
type ShallowDBObject interface {
|
|
GenerateID()
|
|
GetID() string
|
|
GetName() string
|
|
}
|
|
|
|
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
|
|
Search(word string) ([]ShallowDBObject, int, error)
|
|
LoadAll() ([]ShallowDBObject, int, error)
|
|
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 DBObject, id string) (DBObject, int, error)
|
|
}
|