package synchronizator import "fmt" type Collection struct { Node childs []*Node } type collection_relation struct{} func (collection *collection_relation) ToRelationship() (string, []byte, error) { return "IN_COLLECTION", nil, nil } func (collection *collection_relation) FromRelationship(_class string, metadata []byte) error { if _class != "IN_COLLECTION" { return fmt.Errorf("invalid class %s", _class) } return nil } func (collection *Collection) AddChild(node *Node) error { _, err := collection.AddRelation(&collection_relation{}, node.Id) if err != nil { return err } collection.childs = append(collection.childs, node) return nil } // func (node *Collection) Save() error { // return node._conn.UpdateCollection(node.Id, node.metadata) // }