Documentation ¶
Index ¶
- func GetAllocationStats() (int64, int64, int64)
- func IsAuthenticationError(err error) bool
- func IsClientError(err error) bool
- func IsConnectorError(err error) bool
- func IsDatabaseError(err error) bool
- func IsGenericError(err error) bool
- func IsSecurityError(err error) bool
- func IsServiceUnavailable(err error) bool
- func IsSessionExpired(err error) bool
- func IsTransientError(err error) bool
- func IsWriteError(err error) bool
- type AccessMode
- type BoltError
- type Config
- type Connection
- type Connector
- type ConnectorError
- type DatabaseError
- type FetchType
- type GenericError
- type Logging
- type RequestHandle
- type URLAddressResolver
- type ValueHandler
- type ValueHandlerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllocationStats ¶
GetAllocationStats returns statistics about seabolt (C) allocations
func IsAuthenticationError ¶
func IsClientError ¶
func IsConnectorError ¶
IsConnectorError checkes whether given err is a ConnectorError
func IsDatabaseError ¶
IsDatabaseError checkes whether given err is a DatabaseError
func IsGenericError ¶
IsGenericError checkes whether given err is a GenericError
func IsSecurityError ¶
func IsServiceUnavailable ¶
IsServiceUnavailable checkes whether given err represents a service unavailable status
func IsSessionExpired ¶
func IsTransientError ¶
IsTransientError checks whether given err is a transient error
func IsWriteError ¶
IsWriteError checks whether given err can be classified as a write error
Types ¶
type AccessMode ¶
type AccessMode int
AccessMode is used by the routing driver to decide if a transaction should be routed to a write server or a read server in a cluster. When running a transaction, a write transaction requires a server that supports writes. A read transaction, on the other hand, requires a server that supports read operations. This classification is key for routing driver to route transactions to a cluster correctly.
const ( // AccessModeWrite makes the driver return a session towards a write server AccessModeWrite AccessMode = 0 // AccessModeRead makes the driver return a session towards a follower or a read-replica AccessModeRead AccessMode = 1 )
type BoltError ¶
type BoltError interface {
BoltError() bool
}
BoltError is a marker interface to identify neo4j errors
type Config ¶
type Config struct { Encryption bool TLSCertificates []*x509.Certificate TLSSkipVerify bool TLSSkipVerifyHostname bool MaxPoolSize int MaxConnLifetime time.Duration ConnAcquisitionTimeout time.Duration SockConnectTimeout time.Duration SockKeepalive bool ConnectorErrorFactory func(state, code int, codeText, context, description string) ConnectorError DatabaseErrorFactory func(classification, code, message string) DatabaseError GenericErrorFactory func(format string, args ...interface{}) GenericError Log Logging AddressResolver URLAddressResolver ValueHandlers []ValueHandler }
Config holds the available configurations options applicable to the connector
type Connection ¶
type Connection interface { Id() (string, error) RemoteAddress() (string, error) Server() (string, error) Begin(bookmarks []string, txTimeout time.Duration, txMetadata map[string]interface{}) (RequestHandle, error) Commit() (RequestHandle, error) Rollback() (RequestHandle, error) Run(cypher string, parameters map[string]interface{}, bookmarks []string, txTimeout time.Duration, txMetadata map[string]interface{}) (RequestHandle, error) PullAll() (RequestHandle, error) DiscardAll() (RequestHandle, error) Reset() (RequestHandle, error) Flush() error Fetch(request RequestHandle) (FetchType, error) // return type ? FetchSummary(request RequestHandle) (int, error) // return type ? LastBookmark() (string, error) Fields() ([]string, error) Metadata() (map[string]interface{}, error) Data() ([]interface{}, error) Close() error }
Connection represents an active seabolt connection
type Connector ¶
type Connector interface { Acquire(mode AccessMode) (Connection, error) Close() error }
Connector represents an initialised seabolt connector
type ConnectorError ¶
type ConnectorError interface { // State returns the state of the related connection State() int // Code returns the error code set on the related connection Code() int // Context returns the error context set by the connector Context() string // Description returns any additional description set Description() string // Error returns textual representation of the connector level error Error() string }
ConnectorError represents errors that occur on the connector/client side, like network errors, etc.
type DatabaseError ¶
type DatabaseError interface { // Classification returns classification of the error returned from the database Classification() string // Code returns code of the error returned from the database Code() string // Message returns message of the error returned from the database Message() string // Error returns textual representation of the error returned from the database Error() string }
DatabaseError represents errors returned from the server a FAILURE messages
type FetchType ¶
type FetchType int
FetchType identifies the type of the result fetched via Fetch() call
type GenericError ¶
type GenericError interface { // Message returns the underlying error message Message() string // Error returns textual representation of the generic error Error() string }
GenericError represents errors which originates from the connector wrapper itself
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 connector to use
type RequestHandle ¶
type RequestHandle int64
RequestHandle identifies an individual request sent to server
type URLAddressResolver ¶
URLAddressResolver is the callback function signature that provided custom resolver should adhere to
type ValueHandler ¶
type ValueHandler interface { ReadableStructs() []int16 WritableTypes() []reflect.Type Read(signature int16, values []interface{}) (interface{}, error) Write(value interface{}) (int16, []interface{}, error) }
ValueHandler is the interface that custom value handlers should implement to support reading/writing struct types into custom types
type ValueHandlerError ¶
type ValueHandlerError struct {
// contains filtered or unexported fields
}
ValueHandlerError is the special error that ValueHandlers should return in case of unexpected cases
func NewValueHandlerError ¶
func NewValueHandlerError(format string, args ...interface{}) *ValueHandlerError
NewValueHandlerError constructs a new ValueHandlerError
func (*ValueHandlerError) Error ¶
func (ns *ValueHandlerError) Error() string
Error returns textual representation of the value handler error