Browse Source
Replaced inline interface literals with dedicated, documented interface definitions in `pkg/interfaces/`. Introduced `TimeoutError`, `PolicyChecker`, and `Neo4jResultIterator` interfaces to clarify design, improve maintainability, and resolve potential circular dependencies. Updated config and constant usage rules for consistency. Incremented version to v0.31.11.imwald v0.31.11
11 changed files with 177 additions and 23 deletions
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
// Package neterr defines interfaces for network error handling.
|
||||
package neterr |
||||
|
||||
// TimeoutError is an interface for errors that can indicate a timeout.
|
||||
// This is compatible with net.Error's Timeout() method.
|
||||
type TimeoutError interface { |
||||
Timeout() bool |
||||
} |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
// Package resultiter defines interfaces for iterating over database query results.
|
||||
package resultiter |
||||
|
||||
import ( |
||||
"context" |
||||
|
||||
"github.com/neo4j/neo4j-go-driver/v5/neo4j" |
||||
) |
||||
|
||||
// Neo4jResultIterator defines the interface for iterating over Neo4j query results.
|
||||
// This is implemented by both neo4j.Result and CollectedResult types.
|
||||
type Neo4jResultIterator interface { |
||||
Next(context.Context) bool |
||||
Record() *neo4j.Record |
||||
Err() error |
||||
} |
||||
Loading…
Reference in new issue