neo4j

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Neo4jQueryCallStack = testutils.NewCallStack()

Functions

func GetProperty

func GetProperty[T PropertyValue](e Entity, key string) (T, error)

func GetRecordValue

func GetRecordValue[T RecordValue](record *Record, key string) (T, error)

Types

type EagerResult

type EagerResult struct {
	Keys    []string
	Records []*Record
}

func ExecuteQuery

func ExecuteQuery(hostName, query string, parameters map[string]any, opts ...Neo4jOption) (*EagerResult, error)

*

*
* Executes a query or mutation on the Neo4j database.
*
* @param hostName - the name of the host
* @param query - the query to execute
* @param parameters - the parameters to pass to the query

type Entity

type Entity interface {
	GetElementId() string
	GetProperties() map[string]any
}

type Neo4jOption

type Neo4jOption func(*neo4jOptions)

func WithDbName

func WithDbName(dbName string) Neo4jOption

type Node

type Node struct {
	ElementId string         `json:"ElementId"`
	Labels    []string       `json:"Labels"`
	Props     map[string]any `json:"Props"`
}

func (*Node) GetElementId

func (n *Node) GetElementId() string

func (*Node) GetProperties

func (n *Node) GetProperties() map[string]any

type Path

type Path struct {
	Nodes         []Node         `json:"Nodes"`
	Relationships []Relationship `json:"Relationships"`
}

type Point2D

type Point2D struct {
	X            float64
	Y            float64
	SpatialRefId uint32 // Id of coordinate reference system.
}

Point2D represents a two dimensional point in a particular coordinate reference system.

func (Point2D) String

func (p Point2D) String() string

String returns string representation of this point.

type Point3D

type Point3D struct {
	X            float64
	Y            float64
	Z            float64
	SpatialRefId uint32 // Id of coordinate reference system.
}

Point3D represents a three dimensional point in a particular coordinate reference system.

func (Point3D) String

func (p Point3D) String() string

String returns string representation of this point.

type PropertyValue

type PropertyValue interface {
	bool | int64 | float64 | string |
		time.Time | []byte | []any | Point2D | Point3D
}

type Record

type Record struct {
	Values []string
	Keys   []string
}

func (*Record) AsMap

func (r *Record) AsMap() map[string]string

func (*Record) Get

func (r *Record) Get(key string) (string, bool)

type RecordValue

type RecordValue interface {
	bool | int64 | float64 | string |
		time.Time |
		[]byte | []any | map[string]any |
		Node | Relationship | Path | Point2D | Point3D
}

type Relationship

type Relationship struct {
	ElementId      string         `json:"ElementId"`
	StartElementId string         `json:"StartElementId"`
	EndElementId   string         `json:"EndElementId"`
	Type           string         `json:"Type"`
	Props          map[string]any `json:"Props"`
}

func (*Relationship) GetElementId

func (r *Relationship) GetElementId() string

func (*Relationship) GetProperties

func (r *Relationship) GetProperties() map[string]any

Jump to

Keyboard shortcuts

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