add NodeStore

This commit is contained in:
Chris Lu
2021-09-18 15:32:17 -07:00
parent 198fa58e3c
commit e066e2642c
7 changed files with 147 additions and 91 deletions

View File

@@ -45,14 +45,14 @@ func (self *BpNode) maybePersist(shouldPersist bool) error {
return self.persist()
}
func (self *BpNode) persist() error {
if PersistFn != nil {
return PersistFn(self)
if self.nodeStore != nil {
return self.nodeStore.PersistFunc(self)
}
return nil
}
func (self *BpNode) destroy() error {
if DestroyFn != nil {
return DestroyFn(self)
if self.nodeStore != nil {
return self.nodeStore.DestroyFunc(self)
}
return nil
}