21 lines
459 B
Go
21 lines
459 B
Go
package storage
|
|
|
|
type One struct {
|
|
ID string `bson:"_id,omitempty"`
|
|
Relation string `bson:"relation,omitempty"`
|
|
Meta map[string]interface{} `bson:"meta,omitempty"`
|
|
Know []One `bson:"know,omitempty"`
|
|
}
|
|
|
|
func (o One) Knows() []string {
|
|
knows := make([]string, len(o.Know))
|
|
for i := range o.Know {
|
|
knows[i] = o.Know[i].ID
|
|
}
|
|
return knows
|
|
}
|
|
|
|
func (o One) Min() One {
|
|
return One{ID: o.ID}
|
|
}
|