Documentation ¶
Index ¶
- Constants
- type AccessMode
- type AuthToken
- type Config
- type Counters
- func (counters *Counters) ConstraintsAdded() int
- func (counters *Counters) ConstraintsRemoved() int
- func (counters *Counters) IndexesAdded() int
- func (counters *Counters) IndexesRemoved() int
- func (counters *Counters) LabelsAdded() int
- func (counters *Counters) LabelsRemoved() int
- func (counters *Counters) NodesCreated() int
- func (counters *Counters) NodesDeleted() int
- func (counters *Counters) PropertiesSet() int
- func (counters *Counters) RelationshipsCreated() int
- func (counters *Counters) RelationshipsDeleted() int
- type Driver
- type InputPosition
- type LogLevel
- type Logging
- type Node
- type Notification
- type Plan
- type ProfiledPlan
- type Record
- type Relationship
- type Result
- type ResultSummary
- func (summary *ResultSummary) Counters() *Counters
- func (summary *ResultSummary) Notifications() []Notification
- func (summary *ResultSummary) Plan() *Plan
- func (summary *ResultSummary) Profile() *ProfiledPlan
- func (summary *ResultSummary) ResultAvailableAfter() time.Duration
- func (summary *ResultSummary) ResultConsumedAfter() time.Duration
- func (summary *ResultSummary) Server() *ServerInfo
- func (summary *ResultSummary) Statement() *Statement
- func (summary *ResultSummary) StatementType() StatementType
- type ServerInfo
- type Session
- func (session *Session) BeginTransaction() (*Transaction, error)
- func (session *Session) Close() error
- func (session *Session) LastBookmark() string
- func (session *Session) ReadTransaction(work TransactionWork) (interface{}, error)
- func (session *Session) Run(cypher string, params *map[string]interface{}) (*Result, error)
- func (session *Session) WriteTransaction(work TransactionWork) (interface{}, error)
- type Statement
- type StatementType
- type Transaction
- type TransactionWork
Constants ¶
const ( // ERROR is the level that error messages are written ERROR LogLevel = 1 // WARNING is the level that warning messages are written WARNING = 2 // INFO is the level that info messages are written INFO = 3 // DEBUG is the level that debug messages are written DEBUG = 4 )
const ( // StatementTypeUnknown identifies an unknown statement type StatementTypeUnknown StatementType = 0 // StatementTypeReadOnly identifies a read-only statement StatementTypeReadOnly = 1 // StatementTypeReadWrite identifies a read-write statement StatementTypeReadWrite = 2 // StatementTypeWriteOnly identifies a write-only statement StatementTypeWriteOnly = 3 // StatementTypeSchemaWrite identifies a schema-write statement StatementTypeSchemaWrite = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessMode ¶
type AccessMode int
AccessMode defines modes that routing driver decides to which cluster member a connection should be opened.
const ( // AccessModeWrite tells the driver to use a connection to 'Leader' AccessModeWrite AccessMode = 0 // AccessModeRead tells the driver to use a connection to one of the 'Follower' or 'Read Replica'. AccessModeRead = 1 )
type AuthToken ¶
type AuthToken struct {
// contains filtered or unexported fields
}
AuthToken contains credentials to be sent over to the neo4j server.
func BasicAuth ¶
BasicAuth generates a basic authentication token with provided username and password
func CustomAuth ¶
func CustomAuth(scheme string, username string, password string, realm string, parameters *map[string]interface{}) AuthToken
CustomAuth generates a custom authentication token with provided parameters
func KerberosAuth ¶
KerberosAuth generates a kerberos authentication token with provided base-64 encoded kerberos ticket
type Config ¶
type Config struct { // Whether to turn on/off TLS encryption (default: true) Encrypted bool // Logging target the driver will send its log outputs Log Logging // Maximum amount of duration a retriable operation would continue retrying MaxTransactionRetryDuration time.Duration // Maximum number of connections per URL to allow on this driver MaxConnectionPoolSize int }
A Config contains options that can be used to customize certain aspects of the driver
type Counters ¶
type Counters struct {
// contains filtered or unexported fields
}
Counters contains statistics about the changes made to the database made as part of the statement execution.
func (*Counters) ConstraintsAdded ¶
func (*Counters) ConstraintsRemoved ¶
func (*Counters) IndexesAdded ¶
func (*Counters) IndexesRemoved ¶
func (*Counters) LabelsAdded ¶
func (*Counters) LabelsRemoved ¶
func (*Counters) NodesCreated ¶
func (*Counters) NodesDeleted ¶
func (*Counters) PropertiesSet ¶
func (*Counters) RelationshipsCreated ¶
func (*Counters) RelationshipsDeleted ¶
type Driver ¶
type Driver interface { // The url this driver is bootstrapped Target() url.URL Session(accessMode AccessMode, bookmarks ...string) (*Session, error) // Close the driver and all underlying connections Close() error // contains filtered or unexported methods }
Driver represents a pool(s) of connections to a neo4j server or cluster. It's safe for concurrent use.
type InputPosition ¶
type InputPosition struct {
// contains filtered or unexported fields
}
InputPosition contains information about a specific position in a statement
func (*InputPosition) Column ¶
func (pos *InputPosition) Column() int
func (*InputPosition) Line ¶
func (pos *InputPosition) Line() int
func (*InputPosition) Offset ¶
func (pos *InputPosition) Offset() int
type LogLevel ¶
type LogLevel int
LogLevel is the type that default logging implementations use for available log levels
type Logging ¶
type Logging interface { ErrorEnabled() bool WarningEnabled() bool InfoEnabled() bool DebugEnabled() bool Errorf(message string, args ...interface{}) Warningf(message string, args ...interface{}) Infof(message string, args ...interface{}) Debugf(message string, args ...interface{}) }
Logging is the interface that any provided logging target must satisfy for the neo4j driver to send its logging messages
func ConsoleLogger ¶
ConsoleLogger returns a simple logger that writes its messages to the console
func NoOpLogger ¶
func NoOpLogger() Logging
NoOpLogger returns a logger that doesn't generate any output at all
type Notification ¶
type Notification struct {
// contains filtered or unexported fields
}
Notification contains information about notifications generated by the server
func (*Notification) Code ¶
func (notification *Notification) Code() string
func (*Notification) Description ¶
func (notification *Notification) Description() string
func (*Notification) Position ¶
func (notification *Notification) Position() *InputPosition
func (*Notification) Severity ¶
func (notification *Notification) Severity() string
func (*Notification) Title ¶
func (notification *Notification) Title() string
type Plan ¶
type Plan struct {
// contains filtered or unexported fields
}
Plan describes the plan that the database planner produced
func (*Plan) Identifiers ¶
type ProfiledPlan ¶
type ProfiledPlan struct {
// contains filtered or unexported fields
}
Profile describes the plan that the database planner produced and executed
func (*ProfiledPlan) Arguments ¶
func (plan *ProfiledPlan) Arguments() map[string]interface{}
func (*ProfiledPlan) Children ¶
func (plan *ProfiledPlan) Children() []ProfiledPlan
func (*ProfiledPlan) DbHits ¶
func (plan *ProfiledPlan) DbHits() int64
func (*ProfiledPlan) Identifiers ¶
func (plan *ProfiledPlan) Identifiers() []string
func (*ProfiledPlan) Operator ¶
func (plan *ProfiledPlan) Operator() string
func (*ProfiledPlan) Records ¶
func (plan *ProfiledPlan) Records() int64
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record contains ordered keys and values that are returned from a statement executed on the server
func (*Record) GetByIndex ¶
GetByIndex returns the value at given index
type Relationship ¶
type Relationship interface { Id() int64 StartId() int64 EndId() int64 Type() string Props() map[string]interface{} }
Relationship represents a relationship in the neo4j graph database
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result provides access to the result of the executing statement
func (*Result) Consume ¶
func (result *Result) Consume() (*ResultSummary, error)
Consume consumes the entire result and returns the summary information about the statement execution
func (*Result) Summary ¶
func (result *Result) Summary() (*ResultSummary, error)
Summary returns the summary information about the statement execution
type ResultSummary ¶
type ResultSummary struct {
// contains filtered or unexported fields
}
ResultSummary contains information about statement execution.
func (*ResultSummary) Counters ¶
func (summary *ResultSummary) Counters() *Counters
func (*ResultSummary) Notifications ¶
func (summary *ResultSummary) Notifications() []Notification
func (*ResultSummary) Plan ¶
func (summary *ResultSummary) Plan() *Plan
func (*ResultSummary) Profile ¶
func (summary *ResultSummary) Profile() *ProfiledPlan
func (*ResultSummary) ResultAvailableAfter ¶
func (summary *ResultSummary) ResultAvailableAfter() time.Duration
func (*ResultSummary) ResultConsumedAfter ¶
func (summary *ResultSummary) ResultConsumedAfter() time.Duration
func (*ResultSummary) Server ¶
func (summary *ResultSummary) Server() *ServerInfo
func (*ResultSummary) Statement ¶
func (summary *ResultSummary) Statement() *Statement
func (*ResultSummary) StatementType ¶
func (summary *ResultSummary) StatementType() StatementType
type ServerInfo ¶
type ServerInfo struct {
// contains filtered or unexported fields
}
ServerInfo contains basic information of the server
func (*ServerInfo) Address ¶
func (server *ServerInfo) Address() string
func (*ServerInfo) Version ¶
func (server *ServerInfo) Version() string
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents a logical connection (which is not tied to a physical connection) to the server
func (*Session) BeginTransaction ¶
func (session *Session) BeginTransaction() (*Transaction, error)
BeginTransaction starts a new explicit transaction on this session
func (*Session) LastBookmark ¶
func (*Session) ReadTransaction ¶
func (session *Session) ReadTransaction(work TransactionWork) (interface{}, error)
ReadTransaction executes the given unit of work in a AccessModeRead transaction with retry logic in place
func (*Session) WriteTransaction ¶
func (session *Session) WriteTransaction(work TransactionWork) (interface{}, error)
WriteTransaction executes the given unit of work in a AccessModeWrite transaction with retry logic in place
type Statement ¶
type Statement struct {
// contains filtered or unexported fields
}
Statement represents a statement along with its parameters (if any)
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction represents a transaction in the Neo4j database
func (*Transaction) Close ¶
func (transaction *Transaction) Close() error
Close rolls back the actual transaction if it's not already committed/rolled back and closes all resources associated with this transaction
func (*Transaction) Commit ¶
func (transaction *Transaction) Commit() error
Commit commits the transaction
func (*Transaction) Rollback ¶
func (transaction *Transaction) Rollback() error
Rollback rolls back the transaction
type TransactionWork ¶
type TransactionWork func(transaction *Transaction) (interface{}, error)
TransactionWork represents a unit of work that will be executed against the provided transaction