19 lines
442 B
Go
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)
|
|
}
|