Documentation
¶
Index ¶
- func Close(ctx context.Context) error
- func Init(cfg Neo4jConfig) error
- type Neo4jConfig
- type Neo4jStore
- func (s *Neo4jStore) Close(ctx context.Context) error
- func (s *Neo4jStore) CreateRelationship(ctx context.Context, fromLabel, fromKey string, fromValue any, ...) error
- func (s *Neo4jStore) DeleteNode(ctx context.Context, label, key string, value any) error
- func (s *Neo4jStore) DeleteRelationship(ctx context.Context, key string, value any) error
- func (s *Neo4jStore) FindNodes(ctx context.Context, label string, filters map[string]any, limit int) ([]map[string]any, error)
- func (s *Neo4jStore) FindRelationships(ctx context.Context, fromLabel, fromKey string, fromValue any, relType string, ...) ([]map[string]any, error)
- func (s *Neo4jStore) GetNode(ctx context.Context, label, key string, value any) (map[string]any, error)
- func (s *Neo4jStore) Health(ctx context.Context) error
- func (s *Neo4jStore) MergeNode(ctx context.Context, labels []string, matchKey string, matchValue any, ...) error
- func (s *Neo4jStore) Run(ctx context.Context, cypher string, params map[string]any) ([]map[string]any, error)
- func (s *Neo4jStore) RunWrite(ctx context.Context, cypher string, params map[string]any) error
- func (s *Neo4jStore) RunWriteBatch(ctx context.Context, queries []string, paramsList []map[string]any) error
- func (s *Neo4jStore) Traverse(ctx context.Context, startLabel, startKey string, startValue any, ...) ([]map[string]any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Neo4jConfig ¶
type Neo4jConfig struct {
Enabled bool `toml:"enabled"`
URI string `toml:"uri"`
Username string `toml:"username"`
Password string `toml:"password"`
Database string `toml:"database"`
}
Neo4jConfig holds Neo4j connection configuration
func (*Neo4jConfig) Validate ¶
func (c *Neo4jConfig) Validate() error
Validate checks Neo4j configuration.
type Neo4jStore ¶
type Neo4jStore struct {
// contains filtered or unexported fields
}
Neo4jStore provides a generic Neo4j graph store
func (*Neo4jStore) Close ¶
func (s *Neo4jStore) Close(ctx context.Context) error
Close closes the Neo4j connection
func (*Neo4jStore) CreateRelationship ¶
func (s *Neo4jStore) CreateRelationship(ctx context.Context, fromLabel, fromKey string, fromValue any, toLabel, toKey string, toValue any, relType string, properties map[string]any) error
CreateRelationship creates a relationship between two nodes
func (*Neo4jStore) DeleteNode ¶
DeleteNode deletes a node and its relationships
func (*Neo4jStore) DeleteRelationship ¶
DeleteRelationship deletes a relationship by property
func (*Neo4jStore) FindNodes ¶
func (s *Neo4jStore) FindNodes(ctx context.Context, label string, filters map[string]any, limit int) ([]map[string]any, error)
FindNodes finds nodes matching the given criteria
func (*Neo4jStore) FindRelationships ¶
func (s *Neo4jStore) FindRelationships(ctx context.Context, fromLabel, fromKey string, fromValue any, relType string, limit int) ([]map[string]any, error)
FindRelationships finds relationships from a node
func (*Neo4jStore) GetNode ¶
func (s *Neo4jStore) GetNode(ctx context.Context, label, key string, value any) (map[string]any, error)
GetNode retrieves a node by a property match
func (*Neo4jStore) Health ¶
func (s *Neo4jStore) Health(ctx context.Context) error
Health checks Neo4j connection
func (*Neo4jStore) MergeNode ¶
func (s *Neo4jStore) MergeNode(ctx context.Context, labels []string, matchKey string, matchValue any, properties map[string]any) error
MergeNode creates or updates a node based on a match key
func (*Neo4jStore) Run ¶
func (s *Neo4jStore) Run(ctx context.Context, cypher string, params map[string]any) ([]map[string]any, error)
Run executes a Cypher query and returns results as []map[string]any
func (*Neo4jStore) RunWriteBatch ¶
func (s *Neo4jStore) RunWriteBatch(ctx context.Context, queries []string, paramsList []map[string]any) error
RunWriteBatch executes multiple write Cypher queries in a single transaction