new: exposing the graph object to js

This commit is contained in:
Simone Margaritelli 2021-04-09 13:46:33 +02:00
parent 0042b77c36
commit 93b7e7f2ed
8 changed files with 48 additions and 13 deletions

View file

@ -0,0 +1,15 @@
package graph
import (
"github.com/bettercap/bettercap/log"
)
type graphPackage struct{}
func (g graphPackage) IsConnected(nodeType, nodeID string) bool {
if Loaded == nil {
log.Error("graph.IsConnected: graph not loaded")
return false
}
return Loaded.IsConnected(nodeType, nodeID)
}