-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
31 lines (24 loc) · 927 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"context"
"log"
"github.com/neo4j/neo4j-go-driver/v5/neo4j"
"github.com/theapemachine/platform-graph/graphlang"
)
// Main function to demonstrate usage.
func main() {
neo4jURI := "bolt://host.docker.internal:7687"
neo4jUser := "neo4j"
neo4jPassword := "securepassword"
log.Printf("Connecting to Neo4j at %s with user %s and password %s\n", neo4jURI, neo4jUser, neo4jPassword)
driver, err := neo4j.NewDriverWithContext(neo4jURI, neo4j.BasicAuth(neo4jUser, neo4jPassword, ""))
if err != nil {
log.Fatalf("Failed to create Neo4j driver: %v", err)
}
defer driver.Close(context.Background())
session := driver.NewSession(context.Background(), neo4j.SessionConfig{AccessMode: neo4j.AccessModeWrite})
defer session.Close(context.Background())
dirPath := "/app" // Replace with the actual directory path
parser := graphlang.NewTreeSitterParser(driver)
parser.AnalyzeDirectory(dirPath)
}