gobolt

package module
v1.7.0-beta03 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2018 License: Apache-2.0 Imports: 13 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 (
	// FetchTypeRecord tells that fetched data is record
	FetchTypeRecord FetchType = 1
	// FetchTypeMetadata tells that fetched data is metadata
	FetchTypeMetadata = 0
	// FetchTypeError tells that fetch was not successful
	FetchTypeError = -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 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 IsWriteError

func IsWriteError(err error) bool

func NewDatabaseError

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

Types

type AccessMode

type AccessMode int
const (
	AccessModeWrite AccessMode = 0
	AccessModeRead  AccessMode = 1
)

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
	SockRecvTimeout        time.Duration
	SockSendTimeout        time.Duration
	SockKeepalive          bool
	Log                    Logging
	AddressResolver        UrlAddressResolver
	ValueHandlers          []ValueHandler
}

Config holds the available configurations options applicable to the connector

type Connection

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

	Begin(bookmarks []string, txTimeout time.Duration, txMetadata map[string]interface{}) (RequestHandle, error)
	Commit() (RequestHandle, error)
	Rollback() (RequestHandle, error)
	Run(cypher string, args 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
	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

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 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{})
}

type RequestHandle

type RequestHandle int64

RequestHandle identifies an individual request sent to server

type UrlAddressResolver

type UrlAddressResolver func(address *url.URL) []*url.URL

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