Documentation ¶
Index ¶
- type Driver
- func (d *Driver) Close(ctx context.Context)
- func (d *Driver) CloseSession(ctx context.Context, session neo4j.SessionWithContext)
- func (d *Driver) ExecuteQuery(ctx context.Context, query string, params map[string]interface{}, ...) (err error)
- func (d *Driver) NewSession(ctx context.Context) (neo4j.SessionWithContext, error)
- type ResultsHookFn
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) CloseSession ¶
func (d *Driver) CloseSession(ctx context.Context, session neo4j.SessionWithContext)
CloseSession closes any open resources and marks this session as unusable. it wraps the original neo4j.Session.Close() func with af metrics and logs
func (*Driver) ExecuteQuery ¶
func (d *Driver) ExecuteQuery(ctx context.Context, query string, params map[string]interface{}, onResults ResultsHookFn) (err error)
ExecuteQuery runs a query an ensured connected driver via Bolt. it it used with a hook of the original neo4j.Result object for a convenient usage
func (*Driver) NewSession ¶
NewSession returns a new *connected* session only after ensuring the underlying connection is alive. it ensures liveliness by re-creating a new driver in case of connectivity issues. it returns an error in case any connectivity issue could not be resolved even after re-creating the driver.
type ResultsHookFn ¶
type ResultsHookFn func(result neo4j.ResultWithContext) error
ResultsHookFn allows the caller to parse the query results safely