driver

package
v0.0.0-...-a1f1722 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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 NewDriver

func NewDriver(settings Settings) (*Driver, error)

func (*Driver) Close

func (d *Driver) Close(ctx context.Context)

Close safely closes the underlying open connections to the DB.

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

func (d *Driver) NewSession(ctx context.Context) (neo4j.SessionWithContext, error)

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

type Settings

type Settings struct {
	ConnectionString, User, Password string
}

Settings holds the driver settings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL