Documentation ¶
Index ¶
- Constants
- type BoltConn
- type BoltRowReader
- type BoltRows
- type ClosableDriverPool
- type Neo4jDriver
- type NeoDriver
- func (n *NeoDriver) Checker(ctx context.Context, state *health.CheckState) error
- func (n *NeoDriver) Close(ctx context.Context) error
- func (n *NeoDriver) Count(query string) (count int64, err error)
- func (n *NeoDriver) Exec(query string, params map[string]interface{}) (bolt.Result, error)
- func (n *NeoDriver) Healthcheck() (string, error)
- func (n *NeoDriver) Read(query string, mapp mapper.ResultMapper, single bool) error
- func (n *NeoDriver) ReadWithParams(query string, params map[string]interface{}, mapp mapper.ResultMapper, ...) error
- func (n *NeoDriver) StreamRows(query string) (*BoltRowReader, error)
- type Result
Constants ¶
const MsgHealthy = "Neo4j is healthy"
MsgHealthy Check message returned when Neo4j is healthy
const ServiceName = "neo4j"
ServiceName : neo4j
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltRowReader ¶
type BoltRowReader struct {
// contains filtered or unexported fields
}
BoltRowReader translates Neo4j rows to CSV rows.
func NewBoltRowReader ¶
func NewBoltRowReader(rows bolt.Rows, conn bolt.Conn) *BoltRowReader
NewBoltRowReader returns a new reader instace for the given bolt rows.
func (*BoltRowReader) Close ¶
func (reader *BoltRowReader) Close(ctx context.Context) error
Close the contained rows and database connection
func (*BoltRowReader) Read ¶
func (reader *BoltRowReader) Read() (string, error)
Read the next row, or return io.EOF
type ClosableDriverPool ¶
type ClosableDriverPool interface { // OpenPool opens a Neo-specific connection. OpenPool() (bolt.Conn, error) Close() error }
ClosableDriverPool corresponds to the interface bolt.ClosableDriverPool with only the exported fields and methods TODO we might want to modify bolt.ClosableDriverPool with exported fields/methods only and remove this interface I.e. remove reclaim(*boltConn) from driverPool interface in bolt.driver.
type Neo4jDriver ¶
type Neo4jDriver interface { Count(query string) (count int64, err error) Exec(query string, params map[string]interface{}) (bolt.Result, error) Read(query string, mapp mapper.ResultMapper, single bool) error ReadWithParams(query string, params map[string]interface{}, mapp mapper.ResultMapper, single bool) error StreamRows(query string) (*BoltRowReader, error) Checker(ctx context.Context, state *health.CheckState) error driver.Driver }
Neo4jDriver is the interface that wraps basic neo4j driver functionality
type NeoDriver ¶
type NeoDriver struct {
// contains filtered or unexported fields
}
NeoDriver contains a connection pool and allows basic interaction with the database
func New ¶
New neo4j closeable connection pool configured with the provided address, connection pool size and timeout
func NewWithPool ¶
func NewWithPool(pool ClosableDriverPool) (n *NeoDriver)
NewWithPool : New NeoDriver structure containing the pool passed as parameter and a new Check
func (*NeoDriver) Checker ¶
Checker hecks health of Neo4j and updates the provided CheckState accordingly
func (*NeoDriver) Exec ¶
Exec executes the provided query with relevant parameters and returns the response directly
func (*NeoDriver) Healthcheck ¶
Healthcheck calls neo4j to check its health status.
func (*NeoDriver) Read ¶
ReadWithParams takes a query and an indicator of whether a single or list response is expected and writes results into the ResultMapper provided
func (*NeoDriver) ReadWithParams ¶
func (n *NeoDriver) ReadWithParams(query string, params map[string]interface{}, mapp mapper.ResultMapper, single bool) error
ReadWithParams takes a query, a map of parameters and an indicator of whether a single or list response is expected and writes results into the ResultMapper provided
func (*NeoDriver) StreamRows ¶
func (n *NeoDriver) StreamRows(query string) (*BoltRowReader, error)
StreamRows according to provided query into a Reader and return the Reader and any errors. The Reader will contain reference to the database connection and must be closed by the caller.