generated from alecodes/base-template
feat: allow to fetch nodes
This commit is contained in:
parent
3cf643c83d
commit
8af94161ab
8 changed files with 141 additions and 30 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue