feat: allow to fetch nodes

This commit is contained in:
Alexander Navarro 2024-11-22 21:05:15 -03:00
parent 3cf643c83d
commit 8af94161ab
8 changed files with 141 additions and 30 deletions

View file

@ -20,6 +20,15 @@ type Node struct {
metadata []byte // Arbitrary data. This is stored as a jsonb in the database
}
func NewNode(name string, metadata []byte) *Node {
return &Node{
name: name,
_class: "COLLECTION",
metadata: metadata,
Id: -1, // Use -1 to indicate not persisted
}
}
func (node *Node) GetClass() string {
return node._class
}