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