func NewDestroyEntity(c tree.RefContext) (tree.EntityHook, error) {
	return &DestroyEntity{tree.NewBaseHook("destroy-entity", 99), c.DB}, nil
}
NewDestroyEntity returns an initialized DestroyEntity hook for use.
package hooks
import (
	"github.com/netauth/netauth/internal/startup"
	"github.com/netauth/netauth/internal/tree"
	pb "github.com/netauth/protocol"
)
type DestroyEntity struct {
	tree.BaseHook
	tree.DB
}
func (d *DestroyEntity) Run(e, de *pb.Entity) error {
	if e.GetID() == "" {
		e.ID = de.ID
	}
	return d.DeleteEntity(e.GetID())
}
func init() {
	startup.RegisterCallback(destroyEntityCB)
}
func destroyEntityCB() {
	tree.RegisterEntityHookConstructor("destroy-entity", NewDestroyEntity)
}