Extend for Human Readable
This commit is contained in:
@@ -44,6 +44,20 @@ type AbstractObject struct {
|
||||
Signature []byte `bson:"signature,omitempty" json:"signature,omitempty"`
|
||||
}
|
||||
|
||||
func (ri *AbstractObject) Extend(typ ...string) map[string][]tools.DataType {
|
||||
dt := map[string][]tools.DataType{}
|
||||
for _, t := range typ {
|
||||
switch t {
|
||||
case "creator", "user_creator", "user_updater":
|
||||
if _, ok := dt[t]; !ok {
|
||||
dt[t] = []tools.DataType{}
|
||||
}
|
||||
dt[t] = append(dt[t], tools.PEER)
|
||||
}
|
||||
}
|
||||
return dt
|
||||
}
|
||||
|
||||
func (ri *AbstractObject) GetAccessor(request *tools.APIRequest) Accessor {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ type ShallowDBObject interface {
|
||||
// DBObject is an interface that defines the basic methods for a DBObject
|
||||
type DBObject interface {
|
||||
GenerateID()
|
||||
Extend(typ ...string) map[string][]tools.DataType
|
||||
SetNotInCatalog(bool)
|
||||
IsNotInCatalog() bool
|
||||
SetID(id string)
|
||||
|
||||
Reference in New Issue
Block a user