seabolt

package module
v1.7.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2018 License: Apache-2.0 Imports: 9 Imported by: 16

README

neo4j-go-connector

This package is an internal dependency being used by Neo4j Go Driver.

Documentation

Index

Constants

View Source
const (
	// RECORD tells that fetched data is record
	RECORD FetchType = 1
	// METADATA tells that fetched data is metadata
	METADATA = 0
	// ERROR tells that fetch was not successful
	ERROR = -1
)

Variables

This section is empty.

Functions

func GetAllocationStats

func GetAllocationStats() (int64, int64, int64)

GetAllocationStats returns statistics about seabolt (C) allocations

func IsConnectorError

func IsConnectorError(err error) bool

IsConnectorError checkes whether given err is a ConnectorError

func IsDatabaseError

func IsDatabaseError(err error) bool

IsDatabaseError checkes whether given err is a DatabaseError

func IsPoolError

func IsPoolError(err error) bool

IsPoolError checkes whether given err is a PoolError

func IsServiceUnavailable

func IsServiceUnavailable(err error) bool

IsServiceUnavailable checkes whether given err represents a service unavailable status

func IsTransientError

func IsTransientError(err error) bool

IsTransientError checkes whether given err is a transient error

func NewDatabaseError

func NewDatabaseError(details map[string]interface{}) error

Types

type Config

type Config struct {
	Encryption    bool
	Debug         bool
	MaxPoolSize   int
	ValueHandlers []ValueHandler
}

Config holds the available configurations options applicable to the connector

type Connection

type Connection interface {
	RemoteAddress() string
	Server() string

	Begin(bookmarks []string) (RequestHandle, error)
	Commit() (RequestHandle, error)
	Rollback() (RequestHandle, error)
	Run(cypher string, args *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
	Fields() ([]string, error)
	Metadata() (map[string]interface{}, error)
	Data() ([]interface{}, error)

	Close() error
}

Connection represents an active seabolt connection

type Connector

type Connector interface {
	GetPool() (Pool, error)
	Close() error
}

Connector represents an initialised seabolt connector

func NewConnector

func NewConnector(uri *url.URL, authToken map[string]interface{}, config *Config) (connector Connector, err error)

NewConnector returns a new connector instance with given parameters

type ConnectorError

type ConnectorError struct {
	// contains filtered or unexported fields
}

ConnectorError represents errors that occur on the connector/client side, like network errors, etc.

func (*ConnectorError) Code

func (failure *ConnectorError) Code() uint32

func (*ConnectorError) Description

func (failure *ConnectorError) Description() string

func (*ConnectorError) Error

func (failure *ConnectorError) Error() string

TODO: add some text description to the error message based on the state and error codes possibly from connector side Error returns textual representation of the connector level error

func (*ConnectorError) State

func (failure *ConnectorError) State() uint32

type DatabaseError

type DatabaseError struct {
	// contains filtered or unexported fields
}

DatabaseError represents errors returned from the server a FAILURE messages

func (*DatabaseError) Classification

func (failure *DatabaseError) Classification() string

Classification returns classification of the error returned from the database

func (*DatabaseError) Code

func (failure *DatabaseError) Code() string

Code returns code of the error returned from the database

func (*DatabaseError) Error

func (failure *DatabaseError) Error() string

Error returns textual representation of the error returned from the database

func (*DatabaseError) Message

func (failure *DatabaseError) Message() string

Message returns message of the error returned from the database

type FetchType

type FetchType int

FetchType identifies the type of the result fetched via Fetch() call

type Pool

type Pool interface {
	Acquire() (Connection, error)
	Close() error
}

Pool represents an instance of a pool of connections

type PoolError

type PoolError struct {
	// contains filtered or unexported fields
}

func (*PoolError) Code

func (failure *PoolError) Code() uint32

Error returns textual representation of the error returned from the database

func (*PoolError) Error

func (failure *PoolError) Error() string

type RequestHandle

type RequestHandle int64

RequestHandle identifies an individual request sent to server

type ValueHandler

type ValueHandler interface {
	ReadableStructs() []int8
	WritableTypes() []reflect.Type
	Read(signature int8, values []interface{}) (interface{}, error)
	Write(value interface{}) (int8, []interface{}, error)
}

type ValueHandlerError

type ValueHandlerError struct {
	// contains filtered or unexported fields
}

func NewValueHandlerError

func NewValueHandlerError(message string) *ValueHandlerError

func (*ValueHandlerError) Error

func (ns *ValueHandlerError) Error() string

type ValueHandlerNotSupportedError

type ValueHandlerNotSupportedError struct {
}

func (*ValueHandlerNotSupportedError) Error

Directories

Path Synopsis
cmd
go-bolt command

Jump to

Keyboard shortcuts

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