Documentation ¶
Overview ¶
Package neox is a package that wraps and extends the official neo4j bolt driver with useful utilites
Index ¶
- Variables
- type Args
- type Driver
- type Record
- func (r *Record) GetBool(key string) (value bool, ok bool)
- func (r *Record) GetBoolAtIndex(index int) (value bool, ok bool)
- func (r *Record) GetFloat(key string) (value float64, ok bool)
- func (r *Record) GetFloatAtIndex(index int) (value float64, ok bool)
- func (r *Record) GetInt(key string) (value int, ok bool)
- func (r *Record) GetIntAtIndex(index int) (value int, ok bool)
- func (r *Record) GetString(key string) (value string, ok bool)
- func (r *Record) GetStringAtIndex(index int) (value string, ok bool)
- type Result
- type Session
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidArg is returned when provided arguments are invalid ErrInvalidArg = errors.New("the provided destination is not a pointer to a struct") )
Functions ¶
This section is empty.
Types ¶
type Args ¶
type Args map[string]interface{}
Args can be used to pass named arguments to a cypher query
type Driver ¶
Driver is a wrapper around the neo4j representation of connection pool(s) to a neo4j server or cluster. It's safe for concurrent use.
type Record ¶
Record wraps the standard implementation of a neo4j.Record adding some useful utlities
func (*Record) GetBool ¶
GetBool attempts to retrieve a rune value for the provided key If the provided key does not exist, or the value is not a rune, the method returns the zero value and false
func (*Record) GetBoolAtIndex ¶
GetBoolAtIndex retrieves the value for the record at the provided index asserting it as a bool, returning the value and boolean indicating whether the type was asserted correctly
func (*Record) GetFloat ¶
GetFloat attempts to retrieve a float value for the provided key If the provided key does not exist, or the value is not a float, the method returns the zero value and false
func (*Record) GetFloatAtIndex ¶
GetFloatAtIndex retrieves the value for the record at the provided index asserting it as a float, returning the value and boolean indicating whether the type was asserted correctly
func (*Record) GetInt ¶
GetInt attempts to retrieve an integer value for the provided key If the provided key does not exist, or the value is not an integer, the method returns the zero value and false
func (*Record) GetIntAtIndex ¶
GetIntAtIndex retrieves the value for the record at the provided index asserting it as an integer, returning the value and boolean indicating whether the type was asserted to be an integer
type Result ¶
A Result is returned from successful calls to a Session.Runx, it exposes all of the standard driver interface methods as well as its various extensions
func (*Result) Recordx ¶
Recordx returns a neox.Record at the current index in the the result stream
func (*Result) ToStruct ¶
ToStruct attempts to assign the values of the current result record to fields of the provided struct. The argument must be a pointer to a struct or an ErrInvalidArg will be returned. ToStruct will cache results of reflecting on the provided destination type to improve performance on every subsequent call for an instance of a Result. That said, using varying struct types through the lifetime of a single result instance should be considered unsafe and will yield unstable results