Refactored repository structure.

This commit is contained in:
Jay
2026-03-03 13:34:10 -05:00
parent 96f1ceb362
commit e9e153c9a1
15 changed files with 159 additions and 144 deletions

23
graphstore/connect.go Normal file
View File

@@ -0,0 +1,23 @@
package graphstore
import (
"context"
"github.com/neo4j/neo4j-go-driver/v6/neo4j"
)
// ConnectNeo4j creates a new Neo4j driver and verifies its connectivity.
func ConnectNeo4j(ctx context.Context, uri, user, password string) (neo4j.Driver, error) {
driver, err := neo4j.NewDriver(
uri,
neo4j.BasicAuth(user, password, ""))
if err != nil {
return nil, err
}
err = driver.VerifyConnectivity(ctx)
if err != nil {
return nil, err
}
return driver, nil
}