Documentation
¶
Index ¶
- func NewNeo4jRepository(config *Neo4jConfig) (graph.Repository, error)
- type Neo4jConfig
- type Neo4jRepository
- func (r *Neo4jRepository) ClearProject(ctx context.Context, projectID core.ID) error
- func (r *Neo4jRepository) Close() error
- func (r *Neo4jRepository) Connect(ctx context.Context, uri, username, password string) error
- func (r *Neo4jRepository) CreateNode(ctx context.Context, node *core.Node) error
- func (r *Neo4jRepository) CreateNodes(ctx context.Context, nodes []core.Node) error
- func (r *Neo4jRepository) CreateRelationship(ctx context.Context, rel *core.Relationship) error
- func (r *Neo4jRepository) CreateRelationships(ctx context.Context, rels []core.Relationship) error
- func (r *Neo4jRepository) DeleteNode(ctx context.Context, id core.ID) error
- func (r *Neo4jRepository) DeleteRelationship(ctx context.Context, id core.ID) error
- func (r *Neo4jRepository) ExecuteQuery(ctx context.Context, query string, params map[string]any) ([]map[string]any, error)
- func (r *Neo4jRepository) FindNodesByName(ctx context.Context, name string, projectID core.ID) ([]core.Node, error)
- func (r *Neo4jRepository) FindNodesByType(ctx context.Context, nodeType core.NodeType, projectID core.ID) ([]core.Node, error)
- func (r *Neo4jRepository) FindRelationshipsByType(ctx context.Context, relType core.RelationType, projectID core.ID) ([]core.Relationship, error)
- func (r *Neo4jRepository) GetNode(ctx context.Context, id core.ID) (*core.Node, error)
- func (r *Neo4jRepository) GetRelationship(ctx context.Context, id core.ID) (*core.Relationship, error)
- func (r *Neo4jRepository) ImportAnalysisResult(ctx context.Context, result *core.AnalysisResult) error
- func (r *Neo4jRepository) StoreAnalysis(ctx context.Context, result *core.AnalysisResult) error
- func (r *Neo4jRepository) UpdateNode(ctx context.Context, node *core.Node) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNeo4jRepository ¶
func NewNeo4jRepository(config *Neo4jConfig) (graph.Repository, error)
NewNeo4jRepository creates a new Neo4j repository
Types ¶
type Neo4jConfig ¶
type Neo4jConfig struct {
URI string // Neo4j connection URI
Username string // Username for authentication
Password string // Password for authentication
Database string // Database name (optional)
MaxRetries int // Maximum retry attempts
BatchSize int // Batch size for bulk operations
}
Neo4jConfig holds Neo4j connection configuration
type Neo4jRepository ¶
type Neo4jRepository struct {
// contains filtered or unexported fields
}
Neo4jRepository implements the graph.Repository interface
func (*Neo4jRepository) ClearProject ¶
ClearProject removes all nodes and relationships for a specific project
func (*Neo4jRepository) Close ¶
func (r *Neo4jRepository) Close() error
Close closes the Neo4j connection
func (*Neo4jRepository) Connect ¶
func (r *Neo4jRepository) Connect(ctx context.Context, uri, username, password string) error
Connect establishes a connection to Neo4j with retry logic
func (*Neo4jRepository) CreateNode ¶
CreateNode creates a new node in the graph
func (*Neo4jRepository) CreateNodes ¶
CreateNodes creates multiple nodes in a batch using optimized batch processing
func (*Neo4jRepository) CreateRelationship ¶
func (r *Neo4jRepository) CreateRelationship(ctx context.Context, rel *core.Relationship) error
CreateRelationship creates a new relationship
func (*Neo4jRepository) CreateRelationships ¶
func (r *Neo4jRepository) CreateRelationships(ctx context.Context, rels []core.Relationship) error
CreateRelationships creates multiple relationships in a batch using optimized batch processing
func (*Neo4jRepository) DeleteNode ¶
DeleteNode deletes a node by ID
func (*Neo4jRepository) DeleteRelationship ¶
DeleteRelationship deletes a relationship by ID
func (*Neo4jRepository) ExecuteQuery ¶
func (r *Neo4jRepository) ExecuteQuery( ctx context.Context, query string, params map[string]any, ) ([]map[string]any, error)
ExecuteQuery runs a Cypher query and returns results
func (*Neo4jRepository) FindNodesByName ¶
func (r *Neo4jRepository) FindNodesByName( ctx context.Context, name string, projectID core.ID, ) ([]core.Node, error)
FindNodesByName finds nodes by name
func (*Neo4jRepository) FindNodesByType ¶
func (r *Neo4jRepository) FindNodesByType( ctx context.Context, nodeType core.NodeType, projectID core.ID, ) ([]core.Node, error)
FindNodesByType finds all nodes of a specific type
func (*Neo4jRepository) FindRelationshipsByType ¶
func (r *Neo4jRepository) FindRelationshipsByType( ctx context.Context, relType core.RelationType, projectID core.ID, ) ([]core.Relationship, error)
FindRelationshipsByType finds all relationships of a specific type
func (*Neo4jRepository) GetRelationship ¶
func (r *Neo4jRepository) GetRelationship(ctx context.Context, id core.ID) (*core.Relationship, error)
GetRelationship retrieves a relationship by ID
func (*Neo4jRepository) ImportAnalysisResult ¶
func (r *Neo4jRepository) ImportAnalysisResult(ctx context.Context, result *core.AnalysisResult) error
ImportAnalysisResult imports an entire analysis result with optimized batch processing
func (*Neo4jRepository) StoreAnalysis ¶
func (r *Neo4jRepository) StoreAnalysis(ctx context.Context, result *core.AnalysisResult) error
StoreAnalysis stores the complete analysis result in Neo4j
func (*Neo4jRepository) UpdateNode ¶
UpdateNode updates an existing node