tgdb

package
v0.0.0-...-92d0c84 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLogPrefix = "TGDB-GOAPI-Logger: "
	DefaultLogLevel  = WarningLog
	//DefaultLogFlags = log.Ldate|log.Lmicroseconds|log.Lshortfile|log.LUTC
	DefaultLogFlags  = log.Ldate | log.Lmicroseconds | log.LUTC
	DefaultCallDepth = 2
)
View Source
const (
	TYPE_UNKNOWN = iota
	TYPE_OBJECT
	TYPE_ENTITY
	TYPE_ATTR
	TYPE_NODE
	TYPE_EDGE
	TYPE_LIST
	TYPE_MAP
	TYPE_TUPLE
	TYPE_SCALAR
	TYPE_PATH
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback interface {
	OnResponse(msg TGMessage)
}

type ChannelResponseStatus

type ChannelResponseStatus int

======= Channel Response Status =======

const (
	Waiting ChannelResponseStatus = iota
	Ok
	Pushed
	Resend
	Disconnected
	Closed
)

func (ChannelResponseStatus) String

func (responseStatus ChannelResponseStatus) String() string

type ChannelStatus

type ChannelStatus int

======= Channel Status Types =======

const (
	ChannelStatusWaiting ChannelStatus = 1 << iota
	ChannelStatusOk
	ChannelStatusPushed
	ChannelStatusResend
	ChannelStatusDisconnected
	ChannelStatusClosed
)

func (ChannelStatus) String

func (channelStatus ChannelStatus) String() string

type LinkEventHandler

type LinkEventHandler interface {
	OnException(exception TGError, duringClose bool)
	OnReconnect() bool
	GetTerminatedText() string
}

type LinkState

type LinkState int

======= Link State Types =======

const (
	LinkNotConnected LinkState = 1 << iota
	LinkConnected
	LinkClosing
	LinkClosed
	LinkFailedOnSend
	LinkFailedOnRecv
	LinkFailedOnProcessing
	LinkReconnecting
	LinkTerminated
)

func (LinkState) String

func (linkState LinkState) String() string

type LogLevel

type LogLevel int
const (
	TraceLog   LogLevel = 1 << iota
	DebugLog            // 2
	InfoLog             // 4
	WarningLog          // 8
	ErrorLog            // 16
	FatalLog            // 32
	NoLog               // 64
)

func (LogLevel) String

func (logLevel LogLevel) String() string

type MemType

type MemType int

======= Link State Types =======

const (
	MemoryProcess MemType = iota
	MemoryShared
)

type ReconnectState

type ReconnectState int

======= Reconnect State Types =======

const (
	ReconnectStateChannelClosed ReconnectState = 1 << iota
	ReconnectStateSuccess
	ReconnectStateFailed
	ReconnectStateFailedAllAttempts
)

func (ReconnectState) String

func (reconnectState ReconnectState) String() string

type ResendMode

type ResendMode int
const (
	ModeDontReconnectAndIgnore ResendMode = 1 << iota
	ModeReconnectAndResend
	ModeReconnectAndRaiseException
	ModeReconnectAndIgnore
)

======= Resend Mode Types =======

func (ResendMode) String

func (resendMode ResendMode) String() string

type ServerStates

type ServerStates int

======= Link State Types =======

const (
	ServerStateCreated ServerStates = iota
	ServerStateInitialized
	ServerStateStarted
	ServerStateSuspended
	ServerStateInterrupted
	ServerStateRequestStop
	ServerStateStopped
	ServerStateShutDown
)

type StatusTester

type StatusTester interface {
	// Test checks whether the channel response is in WAIT mode or not
	Test(Status ChannelResponseStatus) bool
}

type TGAdminConnection

type TGAdminConnection interface {
	TGConnection
	// CheckpointServer allows the programmatic control to do a checkpoint on server
	CheckpointServer() TGError

	// DumpServerStackTrace allows the programmatic control to dump the stack trace on the server console
	DumpServerStackTrace() TGError

	// GetAttributeDescriptors gets the list of attribute descriptors
	GetAttributeDescriptors() ([]TGAttributeDescriptor, TGError)

	// GetConnections gets the list of all socket connections using this connection type
	GetConnections() ([]TGConnectionInfo, TGError)

	// GetIndices gets the list of all indices
	GetIndices() ([]TGIndexInfo, TGError)

	// GetInfo retrieves the server information (including the server status, listener information,
	// memory information, transaction statistics, cache statistics, database statistics)
	GetInfo() (TGServerInfo, TGError)

	// GetUsers gets the list of users
	GetUsers() ([]TGUserInfo, TGError)

	// KillConnection allows the programmatic control to stop a particular connection instance
	KillConnection(sessionId int64) TGError

	// SetServerLogLevel sets the appropriate log level on server
	SetServerLogLevel(logLevel int, logComponent int64) TGError

	// StopServer allows the programmatic-stop of the server execution
	StopServer() TGError
}

type TGAttribute

type TGAttribute interface {
	TGSerializable
	// GetAttributeDescriptor returns the TGAttributeDescriptor for this attribute
	GetAttributeDescriptor() TGAttributeDescriptor
	// GetIsModified checks whether the attribute modified or not
	GetIsModified() bool
	// GetName gets the name for this attribute as the most generic form
	GetName() string
	// GetOwner gets owner Entity of this attribute
	GetOwner() TGEntity
	// GetValue gets the value for this attribute as the most generic form
	GetValue() interface{}
	// IsNull checks whether the attribute value is null or not
	IsNull() bool
	// ResetIsModified resets the IsModified flag - recursively, if needed
	ResetIsModified()
	// SetOwner sets the owner entity - Need this indirection to traverse the chain
	SetOwner(attrOwner TGEntity)
	// SetValue sets the value for this attribute. Appropriate data conversion to its attribute desc will be performed
	// If the object is Null, then the object is explicitly set, but no value is provided.
	SetValue(value interface{}) TGError
	// ReadValue reads the attribute value from input stream
	ReadValue(is TGInputStream) TGError
	// WriteValue writes the attribute value to output stream
	WriteValue(os TGOutputStream) TGError
	// Additional Method to help debugging
	String() string
}

An Attribute is simple scalar value that is associated with an Entity.

type TGAttributeDescriptor

type TGAttributeDescriptor interface {
	TGSystemObject
	// GetAttributeId returns the attributeId
	GetAttributeId() int64
	// GetAttrType returns the type of Attribute Descriptor
	GetAttrType() int
	// GetPrecision returns the precision for Attribute Descriptor of type Number. The default precision is 20
	GetPrecision() int16
	// GetScale returns the scale for Attribute Descriptor of type Number. The default scale is 5
	GetScale() int16
	// IsAttributeArray checks whether the AttributeType an array desc or not
	IsAttributeArray() bool
	// Is_Encrypted checks whether this attribute is Encrypted or not
	Is_Encrypted() bool
	// SetPrecision sets the prevision for Attribute Descriptor of type Number
	SetPrecision(precision int16)
	// SetScale sets the scale for Attribute Descriptor of type Number
	SetScale(scale int16)
}

An AttributeDescriptor is Basic definition of an Attribute

type TGAttributeFactory

type TGAttributeFactory interface {
	TGSerializable
	// CreateAttributeByType creates a new attribute based on the type specified
	CreateAttributeByType(attrTypeId int) (TGAttribute, TGError)
	// CreateAttribute creates a new attribute based on AttributeDescriptor
	CreateAttribute(attrDesc TGAttributeDescriptor) (TGAttribute, TGError)
	// CreateAttributeWithDesc creates new attribute based on the owner and AttributeDescriptor
	CreateAttributeWithDesc(attrOwner TGEntity, attrDesc TGAttributeDescriptor, value interface{}) (TGAttribute, TGError)
}

An AttributeFactory is a convenient mechanism to create Attribute(s) of various types

type TGCacheStatistics

type TGCacheStatistics interface {
	// GetDataCacheEntries returns the data-cache entries
	GetDataCacheEntries() int
	// GetDataCacheHits returns the data-cache hits
	GetDataCacheHits() int64
	// GetDataCacheMisses returns the data-cache misses
	GetDataCacheMisses() int64
	// GetDataCacheMaxEntries returns the data-cache max entries
	GetDataCacheMaxEntries() int
	// GetDataCacheMaxMemory returns the data-cache max memory
	GetDataCacheMaxMemory() int64
	// GetIndexCacheEntries returns the index-cache entries
	GetIndexCacheEntries() int
	// GetIndexCacheHits returns the index-cache hits
	GetIndexCacheHits() int64
	// GetIndexCacheMisses returns the index-cache misses
	GetIndexCacheMisses() int64
	// GetIndexCacheMaxMemory returns the index-cache max memory
	GetIndexCacheMaxMemory() int64
	// GetIndexCacheMaxEntries returns the index-cache max entries
	GetIndexCacheMaxEntries() int
}

TGCacheStatistics allows users to retrieve the Cache Statistics from server

type TGChangeListener

type TGChangeListener interface {
	// AttributeAdded gets called when an attribute is Added to an entity.
	AttributeAdded(attr TGAttribute, owner TGEntity)
	// AttributeChanged gets called when an attribute is set.
	AttributeChanged(attr TGAttribute, oldValue, newValue interface{})
	// AttributeRemoved gets called when an attribute is removed from the entity.
	AttributeRemoved(attr TGAttribute, owner TGEntity)
	// EntityCreated gets called when an entity is Added
	EntityCreated(entity TGEntity)
	// EntityDeleted gets called when the entity is deleted
	EntityDeleted(entity TGEntity)
	// NodeAdded gets called when a node is Added
	NodeAdded(graph TGGraph, node TGNode)
	// NodeRemoved gets called when a node is removed
	NodeRemoved(graph TGGraph, node TGNode)
}

ChangeListener is an event listener that gets triggered when that event occurs

type TGChannel

type TGChannel interface {
	// ChannelLock locks the communication channel between TGDB client and server
	ChannelLock()
	// ChannelUnlock unlocks the communication channel between TGDB client and server
	ChannelUnlock()
	// Connect connects the underlying channel using the URL end point
	Connect() TGError
	// Disconnect disconnects the channel from its URL end point
	Disconnect() TGError
	// DisablePing disables the pinging ability to the channel
	DisablePing()
	// ExceptionLock locks the communication channel between TGDB client and server in case of business exceptions
	ExceptionLock()
	// ExceptionUnlock unlocks the communication channel between TGDB client and server in case of business exceptions
	ExceptionUnlock()
	// GetAuthToken gets Authorization Token
	GetAuthToken() int64
	// GetClientId gets Client Name
	GetClientId() string
	// GetClientProtocolVersion gets Client Protocol Version
	//GetClientProtocolVersion() int
	// GetChannelURL gets the Channel URL
	GetChannelURL() TGChannelUrl
	// GetConnectionIndex gets the Connection Index
	GetConnectionIndex() int
	// GetDataCryptoGrapher gets the Data Crypto Grapher
	GetDataCryptoGrapher() TGDataCryptoGrapher
	// GetExceptionCondition gets the Exception Condition
	GetExceptionCondition() *sync.Cond
	// GetLinkState gets the Link/Channel State
	GetLinkState() LinkState
	// GetNoOfConnections gets number of connections this channel has
	GetNoOfConnections() int32
	// GetPrimaryURL gets the Primary URL
	GetPrimaryURL() TGChannelUrl
	// GetProperties gets the Channel Properties
	GetProperties() TGProperties
	// GetReader gets the Channel Reader
	GetReader() TGChannelReader
	// GetResponses gets the Channel Response Map
	GetResponses() map[int64]TGChannelResponse
	// GetServerProtocolVersion gets Server Protocol Version
	//GetServerProtocolVersion() int
	// GetSessionId gets Session id
	GetSessionId() int64
	// GetTracer gets the channel Tracer
	GetTracer() TGTracer
	// EnablePing enables the pinging ability to the channel
	EnablePing()
	// IsChannelPingable checks whether the channel is pingable or not
	IsChannelPingable() bool
	// IsClosed checks whether channel is open or closed
	IsClosed() bool
	// SendMessage sends a Message on this channel, and returns immediately - An Asynchronous or Non-Blocking operation
	SendMessage(msg TGMessage) TGError
	// SendRequest sends a Message, waits for a response in the message format, and blocks the thread till it gets the response
	SendRequest(msg TGMessage, response TGChannelResponse) (TGMessage, TGError)
	// SetChannelLinkState sets the Link/Channel State
	SetChannelLinkState(state LinkState)
	// SetChannelURL sets the channel URL
	SetChannelURL(channelUrl TGChannelUrl)
	// SetConnectionIndex sets the connection index
	SetConnectionIndex(index int)
	// SetNoOfConnections sets number of connections
	SetNoOfConnections(count int32)
	// SetResponse sets the ChannelResponse Map
	SetResponse(reqId int64, response TGChannelResponse)
	// SetAuthToken sets the Authorization Token
	SetAuthToken(token int64)
	// DoAuthenticate helps authenticate the external user's credentials
	DoAuthenticate() TGError
	// Start starts the channel so that it can send and receive messages
	Start() TGError
	// Stop stops the channel forcefully or gracefully
	Stop(bForcefully bool)

	// Additional in GO - Abstract declared in Java - to implement function inheritance
	// CreateSocket creates a network socket to transfer the messages in the byte format
	CreateSocket() TGError
	// CloseSocket closes the network socket
	CloseSocket() TGError
	// OnConnect executes functional logic after successfully establishing the connection to the server
	OnConnect() TGError
	// ReadWireMsg read the message from the network in the byte format
	ReadWireMsg() (TGMessage, TGError)
	// Send sends the message to the server, compress and or encrypt.
	// Hence it is abstraction, that the Channel knows about it.
	// @param msg       The message that needs to be sent to the server
	Send(msg TGMessage) TGError
	// Additional Method to help debugging
	String() string
}

type TGChannelReader

type TGChannelReader interface {
	// Start starts the channel reader
	Start()
	// Stop stops the channel reader
	Stop()
	// Additional Method to help debugging
	String() string
}

Channel Reader is an independent thread that starts and stops with the channel, and continuously monitors network communication socket to read and process any message that is sent by the TGDB server

type TGChannelResponse

type TGChannelResponse interface {
	// Await waits (loops) till the channel response receives reply message from the server
	Await(tester StatusTester)
	// GetCallback gets a Callback object
	GetCallback() Callback
	// GetReply gets Reply object
	GetReply() TGMessage
	// GetRequestId gets Request id
	GetRequestId() int64
	// GetStatus gets Status
	GetStatus() ChannelResponseStatus
	// IsBlocking checks whether this channel response is blocking or not
	IsBlocking() bool
	// Reset resets the state of channel response and initializes everything
	Reset()
	// SetReply sets the reply message received from the server
	SetReply(msg TGMessage)
	// SetRequestId sets Request id
	SetRequestId(requestId int64)
	// Signal lets other listeners of channel response know the status of this channel response
	Signal(status ChannelResponseStatus)
}

Channel Response is an independent thread that starts and stops with the channel, and continuously monitors whether server has replied with a message event or not

type TGChannelUrl

type TGChannelUrl interface {
	// GetFTUrls gets the Fault Tolerant URLs
	GetFTUrls() []TGChannelUrl
	// GetHost gets the host part of the URL
	GetHost() string
	// GetPort gets the port on which it is connected
	GetPort() int
	// GetProperties gets the URL Properties
	GetProperties() TGProperties
	// GetProtocol gets the protocol used as part of the URL
	GetProtocol() TGProtocol
	// GetUrlAsString gets the string form of the URL
	GetUrlAsString() string
	// GetUser gets the user associated with the URL
	GetUser() string
}

Channel URL is an encapsulation of all the attributes necessary to construct a valid and meaningful URL to connect to TGDB server

type TGConfigName

type TGConfigName interface {
	// GetAlias gets configuration Alias
	GetAlias() string
	// GetDefaultValue gets configuration Default Value
	GetDefaultValue() string
	// GetName gets configuration name
	GetName() string
}

ConfigName is a configuration object that has a default value, and used in various properties / settings

type TGConnection

type TGConnection interface {
	// Commit commits the current transaction on this connection
	Commit() (TGResultSet, TGError)
	// Connect establishes a network connection to the TGDB server
	Connect() TGError
	// CloseQuery closes a specific query and associated objects
	CloseQuery(queryHashId int64) (TGQuery, TGError)
	// CreateQuery creates a reusable query object that can be used to execute one or more statement
	CreateQuery(expr string) (TGQuery, TGError)
	// DecryptBuffer decrypts the encrypted buffer by sending a DecryptBufferRequest to the server
	DecryptBuffer(is TGInputStream) ([]byte, TGError)
	// DecryptEntity decrypts the encrypted entity using channel's data cryptographer
	DecryptEntity(entityId int64) ([]byte, TGError)
	// DeleteEntity marks an ENTITY for delete operation. Upon commit, the entity will be deleted from the database
	DeleteEntity(entity TGEntity) TGError
	// Disconnect breaks the connection from the TGDB server
	Disconnect() TGError
	// EncryptEntity encrypts the encrypted entity using channel's data cryptographer
	EncryptEntity(rawBuffer []byte) ([]byte, TGError)
	// ExecuteGremlinQuery executes a Gremlin Grammer-Based query with  query options
	ExecuteGremlinQuery(expr string, collection []interface{}, options TGQueryOption) ([]interface{}, TGError)
	// ExecuteQuery executes a query in either tqql or gremlin format.
	// Format is determined by either 'tgql://' or 'gremlin://' prefixes in the 'expr' argument.
	// The format can also be specified by using 'tgdb.connection.defaultQueryLanguage'
	// connection property with value 'tgql' or 'gremlin'. Prefix in the query expression is no needed
	// if connection property is used.
	ExecuteQuery(expr string, options TGQueryOption) (TGResultSet, TGError)
	// ExecuteQueryWithFilter executes an immediate query with specified filter & query options
	// The query option is place holder at this time
	// @param expr A subset of SQL-92 where clause
	// @param edgeFilter filter used for selecting edges to be returned
	// @param traversalCondition condition used for selecting edges to be traversed and returned
	// @param endCondition condition used to stop the traversal
	// @param option Query options for executing. Can be null, then it will use the default option
	ExecuteQueryWithFilter(expr string, edgeFilter string, traversalCondition string, endCondition string, options TGQueryOption) (TGResultSet, TGError)
	// ExecuteQueryWithId executes an immediate query for specified id & query options
	ExecuteQueryWithId(queryHashId int64, option TGQueryOption) (TGResultSet, TGError)
	// GetAddedList gets a list of added entities
	GetAddedList() map[int64]TGEntity
	// GetChangedList gets a list of changed entities
	GetChangedList() map[int64]TGEntity
	// GetChangedList gets the communication channel associated with this connection
	GetChannel() TGChannel
	// GetConnectionId gets connection identifier
	GetConnectionId() int64
	// GetConnectionProperties gets a list of connection properties
	GetConnectionProperties() TGProperties
	// GetEntities gets a result set of entities given an non-uniqueKey
	GetEntities(key TGKey, properties TGProperties) (TGResultSet, TGError)
	// GetEntity gets an Entity given an UniqueKey for the Object
	GetEntity(key TGKey, options TGQueryOption) (TGEntity, TGError)
	// GetGraphMetadata gets the Graph Metadata
	GetGraphMetadata(refresh bool) (TGGraphMetadata, TGError)
	// GetGraphObjectFactory gets the Graph Object Factory for Object creation
	GetGraphObjectFactory() (TGGraphObjectFactory, TGError)
	// GetLargeObjectAsBytes gets an Binary Large Object Entity given an UniqueKey for the Object
	GetLargeObjectAsBytes(entityId int64, decryptFlag bool) ([]byte, TGError)
	// GetRemovedList gets a list of removed entities
	GetRemovedList() map[int64]TGEntity
	// InsertEntity marks an ENTITY for insert operation. Upon commit, the entity will be inserted in the database
	InsertEntity(entity TGEntity) TGError
	// Rollback rolls back the current transaction on this connection
	Rollback() TGError
	// SetConnectionPool sets connection pool
	SetConnectionPool(connPool TGConnectionPool)
	// SetConnectionProperties sets connection properties
	SetConnectionProperties(connProps TGProperties)
	// SetExceptionListener sets exception listener
	SetExceptionListener(listener TGConnectionExceptionListener)
	// UpdateEntity marks an ENTITY for update operation. Upon commit, the entity will be updated in the database
	// When commit is called, the object is resolved to check if it is dirty. Entity.setAttribute calls make the entity
	// dirty. If it is dirty, then the object is send to the server for update, otherwise it is ignored.
	// Calling multiple times, does not change the behavior.
	// The same entity cannot be updated on multiple connections. It will result an TGException of already associated to a connection.
	UpdateEntity(entity TGEntity) TGError
}

type TGConnectionExceptionListener

type TGConnectionExceptionListener interface {
	// OnException registers a callback method with the exception
	OnException(ex TGError)
}

type TGConnectionFactory

type TGConnectionFactory interface {
	CreateConnection(url, user, pwd string, env map[string]string) (TGConnection, TGError)
	CreateAdminConnection(url, user, pwd string, env map[string]string) (TGConnection, TGError)
	CreateConnectionPool(url, user, pwd string, poolSize int, env map[string]string) (TGConnectionPool, TGError)
	CreateConnectionPoolWithType(url, user, pwd string, poolSize int, env map[string]string, connType TypeConnection) (TGConnectionPool, TGError)
}

type TGConnectionInfo

type TGConnectionInfo interface {
	// GetClientID returns a client ID of listener
	GetClientID() string
	// GetCreatedTimeInSeconds returns a time when the listener was created
	GetCreatedTimeInSeconds() int64
	// GetListenerName returns a name of a particular listener
	GetListenerName() string
	// GetRemoteAddress returns a remote address of listener
	GetRemoteAddress() string
	// GetSessionID returns a session ID of listener
	GetSessionID() int64
	// GetUserName returns a user-name associated with listener
	GetUserName() string
}

TGConnectionInfo allows users to retrieve the individual Connection Information from server

type TGConnectionPool

type TGConnectionPool interface {
	// AdminLock locks the connection pool so that the list of connections can be updated
	AdminLock()
	// AdminUnlock unlocks the connection pool so that the list of connections can be updated
	AdminUnlock()
	// Connect establishes connection from this pool of available/configured connections to the TGDB server
	// Exception could be BadAuthentication or BadUrl
	Connect() TGError
	// Disconnect breaks the connection from the TGDB server and returns the connection back to this connection pool for reuse
	Disconnect() TGError
	// Get returns a free connection from the connection pool
	// The property ConnectionReserveTimeoutSeconds or tgdb.connectionpool.ConnectionReserveTimeoutSeconds specifies the time
	// to wait in seconds. It has the following meaning
	// 0 :      Indefinite
	// -1 :     Immediate
	// &gt; :   That many seconds
	Get() (TGConnection, TGError)
	// GetPoolSize gets pool size
	GetPoolSize() int
	// ReleaseConnection frees the connection and sends back to the pool
	ReleaseConnection(conn TGConnection) (TGConnectionPool, TGError)
	// SetExceptionListener sets exception listener
	SetExceptionListener(lsnr TGConnectionExceptionListener)
}

type TGDataCryptoGrapher

type TGDataCryptoGrapher interface {
	// Decrypt decrypts the buffer
	//Decrypt(encBuffer []byte) ([]byte, TGError)
	Decrypt(is TGInputStream) ([]byte, TGError)
	// Encrypt encrypts the buffer
	Encrypt(decBuffer []byte) ([]byte, TGError)
}

DataCryptoGrapher is an event listener that gets triggered when that event occurs

type TGDatabaseStatistics

type TGDatabaseStatistics interface {
	// GetBlockSize returns the block size
	GetBlockSize() int
	// GetDataBlockSize returns the block size of data
	GetDataBlockSize() int
	// GetDataFree returns the free data size
	GetDataFree() int64
	// GetDataSize returns data size
	GetDataSize() int64
	// GetDataUsed returns the size of data used
	GetDataUsed() int64
	// GetDbSize returns the size of database
	GetDbSize() int64
	// GetIndexFree returns the free index size
	GetIndexFree() int64
	// GetIndexSize returns the index size
	GetIndexSize() int64
	// GetIndexUsed returns the size of index used
	GetIndexUsed() int64
	// GetNumDataSegments returns the number of data segments
	GetNumDataSegments() int
	// GetNumIndexSegments returns the number of index segments
	GetNumIndexSegments() int
}

TGDatabaseStatistics allows users to retrieve the database statistics from server

type TGDirection

type TGDirection int
const (
	DirectionInbound TGDirection = iota
	DirectionOutbound
	DirectionAny
)

func (TGDirection) String

func (direction TGDirection) String() string

type TGDirectionType

type TGDirectionType int
const (
	DirectionTypeUnDirected TGDirectionType = iota
	DirectionTypeDirected
	DirectionTypeBiDirectional
)

func (TGDirectionType) String

func (directionType TGDirectionType) String() string

type TGEdge

type TGEdge interface {
	TGEntity
	// GetDirectionType gets direction type as one of the constants
	GetDirectionType() TGDirectionType
	// GetVertices gets array of NODE (Entity) types for this EDGE (Entity) type
	GetVertices() []TGNode
}

type TGEdgeType

type TGEdgeType interface {
	TGEntityType
	// GetDirectionType gets direction type as one of the constants
	GetDirectionType() TGDirectionType
	// GetFromNodeType gets From-Node Type
	GetFromNodeType() TGNodeType
	// GetFromTypeId gets From-Node ID
	GetFromTypeId() int
	// GetToNodeType gets To-Node Type
	GetToNodeType() TGNodeType
	// GetToTypeId gets To-Node ID
	GetToTypeId() int
	// SetFromNodeType sets From-Node Type
	SetFromNodeType(fromNode TGNodeType)
	// SetFromTypeId sets From-Node ID
	SetFromTypeId(fromTypeId int)
	// SetToNodeType sets From-Node Type
	SetToNodeType(toNode TGNodeType)
	// SetToTypeId sets To-Node ID
	SetToTypeId(toTypeId int)
}

type TGEntity

type TGEntity interface {
	TGSerializable
	// GetAttribute gets the attribute for the name specified
	GetAttribute(name string) TGAttribute
	// GetAttributes lists of all the attributes set
	GetAttributes() ([]TGAttribute, TGError)
	// GetEntityKind returns the EntityKind as a constant
	GetEntityKind() TGEntityKind
	// GetEntityType returns the EntityType
	GetEntityType() TGEntityType
	// GetGraphMetadata returns the Graph Meta Data	- New in GO Lang
	GetGraphMetadata() TGGraphMetadata
	// GetIsDeleted checks whether this entity is already deleted in the system or not
	GetIsDeleted() bool
	// GetIsNew checks whether this entity that is currently being added to the system is new or not
	GetIsNew() bool
	// GetVersion gets the version of the Entity
	GetVersion() int
	// GetVirtualId gets Entity identifier
	// At the time of creation before reaching the server, it is the virtual id
	// Upon successful creation, server returns a valid entity id that gets set in place of virtual id
	GetVirtualId() int64
	// IsAttributeSet checks whether this entity is an Attribute set or not
	IsAttributeSet(attrName string) bool
	// ResetModifiedAttributes resets the dirty flag on attributes
	ResetModifiedAttributes()
	// SetAttribute associates the specified Attribute to this Entity
	SetAttribute(attr TGAttribute) TGError
	// SetOrCreateAttribute dynamically associates the attribute to this entity
	// If the AttributeDescriptor doesn't exist in the database, create a new one
	SetOrCreateAttribute(name string, value interface{}) TGError
	// SetEntityId sets Entity id and reset Virtual id after creation
	SetEntityId(id int64)
	// SetIsDeleted set the deleted flag
	SetIsDeleted(flag bool)
	// SetIsInitialized set the initialized flag
	SetIsInitialized(flag bool)
	// SetIsNew sets the flag that this is a new entity
	SetIsNew(flag bool)
	// SetVersion sets the version of the Entity
	SetVersion(version int)
	// Additional Method to help debugging
	String() string
}

type TGEntityId

type TGEntityId interface {
	TGSerializable
	// ToBytes converts the Entity Id in binary format
	ToBytes() ([]byte, TGError)
}

type TGEntityKind

type TGEntityKind int

======= Various Entity Kind =======

const (
	EntityKindInvalid   TGEntityKind = iota
	EntityKindEntity                 //TGEntityKind = 1
	EntityKindNode                   //TGEntityKind = 2
	EntityKindEdge                   //TGEntityKind = 3
	EntityKindGraph                  //TGEntityKind = 4
	EntityKindHyperEdge              //TGEntityKind = 5
)

func (TGEntityKind) String

func (kind TGEntityKind) String() string

type TGEntityType

type TGEntityType interface {
	TGSystemObject
	// AddAttributeDescriptor add an attribute descriptor to the map
	AddAttributeDescriptor(attrName string, attrDesc TGAttributeDescriptor)
	// GetEntityTypeId gets Entity Type id
	GetEntityTypeId() int
	// DerivedFrom gets the parent Entity Type
	DerivedFrom() TGEntityType
	// GetAttributeDescriptor gets the attribute descriptor for the specified name
	GetAttributeDescriptor(attrName string) TGAttributeDescriptor
	// GetAttributeDescriptors returns a collection of attribute descriptors associated with this Entity Type
	GetAttributeDescriptors() []TGAttributeDescriptor
	// SetEntityTypeId sets Entity Type id
	SetEntityTypeId(eTypeId int)
	// SetName sets the system object's name
	SetName(eTypeName string)
	// SetSystemType sets system object's type
	SetSystemType(eSysType TGSystemType)
	// Additional Method to help debugging
	String() string
}

type TGError

type TGError interface {
	error
	// Get the detail error message
	GetErrorCode() string
	GetErrorType() int
	GetErrorMsg() string
	GetErrorDetails() string
	GetServerErrorCode() int
}

type TGExceptionType

type TGExceptionType int

======= Various Error Types =======

type TGFilter

type TGFilter interface {
}

type TGGraph

type TGGraph interface {
	TGNode
	// AddNode adds an EntityKindEdge to another EntityKindNode
	AddNode(node TGNode) (TGGraph, TGError)
	// AddEdges adds a collection of edges for this node
	AddEdges(edges []TGEdge) (TGGraph, TGError)
	// GetNode gets a unique node which matches the unique constraint
	GetNode(filter TGFilter) (TGNode, TGError)
	// ListNodes lists all the nodes that match the filter and recurse All sub graphs
	ListNodes(filter TGFilter, recurseAllSubGraphs bool) (TGNode, TGError)
	// CreateGraph creates a sub graph within this graph
	CreateGraph(name string) (TGGraph, TGError)
	// RemoveGraph removes the graph
	RemoveGraph(name string) (TGGraph, TGError)
	// RemoveNode removes this node from the graph
	RemoveNode(node TGNode) (TGGraph, TGError)
	// RemoveNodes removes a set of nodes from this graph that match the filter
	RemoveNodes(filter TGFilter) int
}

type TGGraphManager

type TGGraphManager interface {
	// CreateNode creates Node within this Graph. There is a default Root Graph.
	CreateNode() (TGNode, TGError)
	// CreateNodeForNodeType creates Node of particular Type
	CreateNodeForNodeType(nodeType TGNodeType) (TGNode, TGError)
	// CreateEdge creates an Edge
	CreateEdge(fromNode TGNode, toNode TGNode, edgeType int) (TGEdge, TGError)
	// CreateEdgeWithDirection creates an Edge with direction
	CreateEdgeWithDirection(fromNode TGNode, toNode TGNode, directionType TGDirectionType) (TGEdge, TGError)
	// CreateGraph creates a SubGraph at the Root level.
	CreateGraph(name string) (TGGraph, TGError)
	// DeleteNode removes this node from the graph
	DeleteNode(filter TGFilter) (TGGraphManager, TGError)
	// DeleteNodes removes the nodes from this graph that match the filter
	DeleteNodes(filter TGFilter) (TGGraphManager, TGError)
	// CreateQuery creates a Reusable Query
	CreateQuery(filter TGFilter) TGQuery
	// QueryNodes gets Nodes based on the Filter condition with a set of Arguments
	QueryNodes(filter TGFilter, args ...interface{}) TGResultSet
	// Traverse follows the graph using the traversal descriptor
	Traverse(descriptor TGTraversalDescriptor, startingPoints []TGNode) TGResultSet
	// GetGraphMetadata gets the Graph Metadata
	GetGraphMetadata() TGGraphMetadata
}

type TGGraphMetadata

type TGGraphMetadata interface {
	TGSerializable
	// CreateAttributeDescriptor creates Attribute Descriptor
	CreateAttributeDescriptor(attrName string, attrType int, isArray bool) TGAttributeDescriptor
	// CreateAttributeDescriptorForDataType creates Attribute Descriptor for data/attribute type - New in GO Lang
	CreateAttributeDescriptorForDataType(attrName string, dataTypeClassName string) TGAttributeDescriptor
	// GetAttributeDescriptor gets the Attribute Descriptor by name
	GetAttributeDescriptor(attributeName string) (TGAttributeDescriptor, TGError)
	// GetAttributeDescriptorById gets the Attribute Descriptor by name
	GetAttributeDescriptorById(id int64) (TGAttributeDescriptor, TGError)
	// GetAttributeDescriptors gets a list of Attribute Descriptors
	GetAttributeDescriptors() ([]TGAttributeDescriptor, TGError)
	// CreateCompositeKey creates composite key
	CreateCompositeKey(nodeTypeName string) TGKey
	// CreateEdgeType creates Edge Type
	CreateEdgeType(typeName string, parentEdgeType TGEdgeType) TGEdgeType
	// GetConnection returns the connection from its graph object factory
	GetConnection() TGConnection
	// GetEdgeType returns the Edge by name
	GetEdgeType(typeName string) (TGEdgeType, TGError)
	// GetEdgeTypeById returns the Edge Type by id
	GetEdgeTypeById(id int) (TGEdgeType, TGError)
	// GetEdgeTypes returns a set of know edge Type
	GetEdgeTypes() ([]TGEdgeType, TGError)
	// CreateNodeType creates a Node Type
	CreateNodeType(typeName string, parentNodeType TGNodeType) TGNodeType
	// GetNodeType gets Node Type by name
	GetNodeType(typeName string) (TGNodeType, TGError)
	// GetNodeTypeById returns the Node types by id
	GetNodeTypeById(id int) (TGNodeType, TGError)
	// GetNodeTypes returns a set of Node Type defined in the System
	GetNodeTypes() ([]TGNodeType, TGError)
}

type TGGraphObjectFactory

type TGGraphObjectFactory interface {
	// CreateCompositeKey creates a CompositeKey for a SystemTypeNode. The composite key can also be a single key
	CreateCompositeKey(nodeTypeName string) (TGKey, TGError)
	// CreateEdgeWithEdgeType creates an Edge
	CreateEdgeWithEdgeType(fromNode TGNode, toNode TGNode, edgeType TGEdgeType) (TGEdge, TGError)
	// CreateEdgeWithDirection creates an Edge with a direction
	CreateEdgeWithDirection(fromNode TGNode, toNode TGNode, directionType TGDirectionType) (TGEdge, TGError)
	// CreateEntity creates entity based on the entity kind specified
	CreateEntity(entityKind TGEntityKind) (TGEntity, TGError)
	// CreateEntityId creates entity id from input buffer
	CreateEntityId(buf []byte) (TGEntityId, TGError)
	// CreateGraph creates a Graph
	CreateGraph(name string) (TGGraph, TGError)
	// CreateNode creates a Node
	CreateNode() (TGNode, TGError)
	// CreateNodeInGraph creates Node within this Graph. There is a default Root Graph.
	CreateNodeInGraph(nodeType TGNodeType) (TGNode, TGError)
}

type TGIndexInfo

type TGIndexInfo interface {
	// GetAttributes returns a collection of attribute names
	GetAttributeNames() []string
	// GetName returns the index name
	GetName() string
	// GetNumEntries returns the number of entries for the index
	GetNumEntries() int64
	// GetType returns the index type
	GetType() byte
	// GetStatus returns the status of the index
	GetStatus() string
	// GetSystemId returns the system ID
	GetSystemId() int
	// GetNodeTypes returns a collection of node types
	GetNodeTypes() []string
	// IsUnique returns the information whether the index is unique
	IsUnique() bool
}

TGIndexInfo users to retrieve the index information from server

type TGInputStream

type TGInputStream interface {
	// Available checks whether there is any data available on the stream to read
	Available() (int, TGError)
	// GetPosition gets the current position of internal cursor
	GetPosition() int64
	// GetReferenceMap returns a user maintained reference map
	GetReferenceMap() map[int64]TGEntity
	// Mark marks the current position
	Mark(readlimit int)
	// MarkSupported checks whether the marking is supported or not
	MarkSupported() bool
	// Read reads the current byte
	Read() (int, TGError)
	// ReadIntoBuffer copies bytes in specified buffer
	// The buffer cannot be NIL
	ReadIntoBuffer(b []byte) (int, TGError)
	// ReadAtOffset is similar to readFully.
	ReadAtOffset(b []byte, off int, length int) (int, TGError)
	// ReadBytes reads an encoded byte array. writeBytes encodes the length, and the byte[].
	// This is equivalent to do a readInt, and read(byte[])
	ReadBytes() ([]byte, TGError)
	// ReadVarLong reads a Variable long field
	ReadVarLong() (int64, TGError)
	// Reset brings internal moving cursor back to the old position
	Reset()
	// SetPosition sets the position of reading.
	SetPosition(position int64) int64
	// SetReferenceMap sets a user maintained map as reference data
	SetReferenceMap(rMap map[int64]TGEntity)
	// Skip skips n bytes
	Skip(n int64) (int64, TGError)
}

type TGKey

type TGKey interface {
	TGSerializable
	// Dynamically set the attribute to this entity. If the AttributeDescriptor doesn't exist in the database, create a new one.
	SetOrCreateAttribute(name string, value interface{}) TGError
}

type TGLogger

type TGLogger interface {
	// Trace logs Trace Statements
	Trace(formattedLogMsg string)
	// Debug logs Debug Statements
	Debug(formattedLogMsg string)
	// Info logs Info Statements
	Info(formattedLogMsg string)
	// Warning logs Warning Statements
	Warning(formattedLogMsg string)
	// Error logs Error Statements
	Error(formattedLogMsg string)
	// Fatal logs Fatal Statements
	Fatal(formattedLogMsg string)
	// Log is a generic function that introspects the log level configuration set for the current session, and
	// appropriately calls the level specific logging functions
	Log(logMsg string)

	GetLogLevel() LogLevel
	// SetLogLevel sets Log Level
	SetLogLevel(level LogLevel)
	// GetLogPrefix gets Log Prefix
	GetLogPrefix() string
	// SetLogPrefix sets Log Prefix
	SetLogPrefix(prefix string)
	// SetLogWriter sets Log Writer
	SetLogWriter(writer io.Writer)
	// SetLogFormatFlags sets Log Format
	SetLogFormatFlags(flags int)

	SetLogBaseDir(logBaseDr string) error
	GetLogBaseDir() string
	SetFileNameBase(baseFileName string) error
	GetFileNameBase() string
	SetFileCount(count int)
	GetFileCount() int
	SetFileSize(size int)
	GetFileSize() int
	// Additional Method to help debugging
	String() string

	IsDebug() bool
	IsInfo() bool
	IsTrace() bool
	IsWarning() bool
}

type TGMemoryInfo

type TGMemoryInfo interface {
	// GetFreeMemory returns the free memory size from server
	GetFreeMemory() int64
	// GetMaxMemory returns the max memory size from server
	GetMaxMemory() int64
	// GetSharedMemoryFileLocation returns the shared memory file location
	GetSharedMemoryFileLocation() string
	// GetUsedMemory returns the used memory size from server
	GetUsedMemory() int64
}

TGMemoryInfo allows users to retrieve the memory information from server

type TGMessage

type TGMessage interface {
	// FromBytes constructs a message object from the input buffer in the byte format
	FromBytes(buffer []byte) (TGMessage, TGError)
	// ToBytes converts a message object into byte format to be sent over the network to TGDB server
	ToBytes() ([]byte, int, TGError)
	// GetAuthToken gets the authToken
	GetAuthToken() int64
	// GetIsUpdatable checks whether this message updatable or not
	GetIsUpdatable() bool
	// GetMessageByteBufLength gets the MessageByteBufLength. This method is called after the toBytes() is executed.
	GetMessageByteBufLength() int
	// GetRequestId gets the requestId for the message. This will be used as the CorrelationId
	GetRequestId() int64
	// GetSequenceNo gets the sequenceNo of the message
	GetSequenceNo() int64
	// GetSessionId gets the session id
	GetSessionId() int64
	// GetTimestamp gets the Timestamp
	GetTimestamp() int64
	// GetVerbId gets verbId of the message
	GetVerbId() int
	// GetTenantId gets the tenantId of the message
	GetTenantId() int
	// SetTenantId sets the tenantId
	SetTenantId(id int)
	// Additional Method to help debugging
	String() string

	// SetAuthToken sets the authToken
	SetAuthToken(authToken int64)
	// SetDataOffset sets the offset at which data starts in the payload
	SetDataOffset(dataOffset int16)
	// SetIsUpdatable sets the updatable flag
	SetIsUpdatable(updateFlag bool)
	// SetMessageByteBufLength sets the message buffer length
	SetMessageByteBufLength(bufLength int)
	// SetRequestId sets the request id
	SetRequestId(requestId int64)
	// SetSequenceNo sets the sequenceNo
	SetSequenceNo(sequenceNo int64)
	// SetSessionId sets the session id
	SetSessionId(sessionId int64)
	// SetTimestamp sets the timestamp
	SetTimestamp(timestamp int64) TGError
	// SetVerbId sets verbId of the message
	SetVerbId(verbId int)

	// UpdateSequenceAndTimeStamp updates the SequenceAndTimeStamp, if message is mutable
	// @param timestamp
	// @return TGMessage on success, error on failure
	UpdateSequenceAndTimeStamp(timestamp int64) TGError

	// ReadHeader reads the bytes from input stream and constructs a common header of network packet
	ReadHeader(is TGInputStream) TGError
	// WriteHeader exports the values of the common message header attributes to output stream
	WriteHeader(os TGOutputStream) TGError
	// ReadPayload reads the bytes from input stream and constructs message specific payload attributes
	ReadPayload(is TGInputStream) TGError
	// WritePayload exports the values of the message specific payload attributes to output stream
	WritePayload(os TGOutputStream) TGError
}

This is the main interface for all message types

type TGNetListenerInfo

type TGNetListenerInfo interface {
	// GetCurrentConnections returns the count of current connections
	GetCurrentConnections() int
	// GetMaxConnections returns the count of max connections
	GetMaxConnections() int
	// GetListenerName returns the listener name
	GetListenerName() string
	// GetPortNumber returns the port detail of this listener
	GetPortNumber() string
}

TGNetListenerInfo allows users to retrieve the Net-Listener information from server

type TGNode

type TGNode interface {
	TGEntity
	// Add another Edge to Node
	AddEdge(edge TGEdge)
	// Add another Edge with direction to Node
	AddEdgeWithDirectionType(node TGNode, edgeType TGEdgeType, directionType TGDirectionType) TGEdge
	// Return entire collection edges
	GetEdges() []TGEdge
	// Return collection edges for the direction desc
	GetEdgesForDirectionType(directionType TGDirectionType) []TGEdge
	// Return collection filtered edges
	GetEdgesForEdgeType(edgeType TGEdgeType, direction TGDirection) []TGEdge
}

type TGNodeType

type TGNodeType interface {
	TGEntityType
	// GetPKeyAttributeDescriptors returns a set of primary key descriptors
	GetPKeyAttributeDescriptors() []TGAttributeDescriptor
}

type TGOutputStream

type TGOutputStream interface {
	// GetBuffer gets the underlying Buffer
	GetBuffer() []byte
	// GetLength gets the total write length
	GetLength() int
	// GetPosition gets the current write position
	GetPosition() int
	// SkipNBytes skips n bytes. Allocate if necessary
	SkipNBytes(n int)
	// ToByteArray returns a new constructed byte array of the data that is being streamed.
	ToByteArray() ([]byte, TGError)
	// WriteBooleanAt writes boolean at a given position. Buffer should have sufficient space to write the content.
	WriteBooleanAt(pos int, value bool) (int, TGError)
	// WriteByteAt writes a byte at the position. Buffer should have sufficient space to write the content.
	WriteByteAt(pos int, value int) (int, TGError)
	// WriteBytes writes the len, and the byte array into the buffer
	WriteBytes(buf []byte) TGError
	// WriteBytesAt writes string at the position. Buffer should have sufficient space to write the content.
	WriteBytesAt(pos int, s string) (int, TGError)
	// WriteCharAt writes a Java Char at the position. Buffer should have sufficient space to write the content.
	WriteCharAt(pos int, value int) (int, TGError)
	// WriteCharsAt writes Chars at the position. Buffer should have sufficient space to write the content.
	WriteCharsAt(pos int, s string) (int, TGError)
	// WriteDoubleAt writes Double at the position. Buffer should have sufficient space to write the content.
	WriteDoubleAt(pos int, value float64) (int, TGError)
	// WriteFloatAt writes Float at the position. Buffer should have sufficient space to write the content.
	WriteFloatAt(pos int, value float32) (int, TGError)
	// WriteIntAt writes Integer at the position.Buffer should have sufficient space to write the content.
	WriteIntAt(pos int, value int) (int, TGError)
	// WriteLongAsBytes writes Long in byte format
	WriteLongAsBytes(value int64) TGError
	// WriteLongAt writes Long at the position. Buffer should have sufficient space to write the content.
	WriteLongAt(pos int, value int64) (int, TGError)
	// WriteShortAt writes a Java Char at the position. Buffer should have sufficient space to write the content.
	WriteShortAt(pos int, value int) (int, TGError)
	// WriteUTFString writes UTFString
	WriteUTFString(str string) (int, TGError)
	// WriteVarLong writes a long value as varying length into the buffer.
	WriteVarLong(value int64) TGError
}

type TGProperties

type TGProperties interface {
	// AddProperty checks whether a property already exists, else adds a new property in the form of name=value pair
	AddProperty(name, value string)
	// GetProperty gets the property either with value or default value
	GetProperty(cn TGConfigName, value string) string
	// SetProperty sets existing property value in the form of name=value pair
	SetProperty(name, value string)
	// SetUserAndPassword sets urlUser and password
	//SetUserAndPassword(user, pwd string) TGError
	// GetPropertyAsInt gets Property as int value
	GetPropertyAsInt(cn TGConfigName) int
	// GetPropertyAsLong gets Property as long value
	GetPropertyAsLong(cn TGConfigName) int64
	// GetPropertyAsBoolean gets Property as bool value
	GetPropertyAsBoolean(cn TGConfigName) bool
}

type TGProtocol

type TGProtocol int

======= Protocol Types Supported =======

const (
	ProtocolTCP TGProtocol = 1 << iota
	ProtocolSSL
	ProtocolHTTP
	ProtocolHTTPS
)

func (TGProtocol) String

func (proType TGProtocol) String() string

type TGQuery

type TGQuery interface {
	// Close closes the Query
	Close()
	// Execute executes the Query
	Execute() TGResultSet
	// SetBoolean sets Boolean parameter
	SetBoolean(name string, value bool)
	// SetBytes sets Byte Parameter
	SetBytes(name string, bos []byte)
	// SetChar sets Character Parameter
	SetChar(name string, value string)
	// SetDate sets Date Parameter
	SetDate(name string, value time.Time)
	// SetDouble sets Double Parameter
	SetDouble(name string, value float64)
	// SetFloat sets Float Parameter
	SetFloat(name string, value float32)
	// SetInt sets Integer Parameter
	SetInt(name string, value int)
	// SetLong sets Long Parameter
	SetLong(name string, value int64)
	// SetNull sets the parameter to null
	SetNull(name string)
	// SetOption sets the Query Option
	SetOption(options TGQueryOption)
	// SetShort sets Short Parameter
	SetShort(name string, value int16)
	// SetString sets String Parameter
	SetString(name string, value string)
	// Additional Method to help debugging
	String() string
}

type TGQueryOption

type TGQueryOption interface {
	TGProperties
	// GetBatchSize gets the current value of the batch size
	GetBatchSize() int
	// SetBatchSize sets a limit on the batch. Default is 50
	SetBatchSize(size int) TGError
	// GetPreFetchSize gets the current value of the pre-fetch size
	GetPreFetchSize() int
	// SetPreFetchSize sets a limit on the number of entities(nodes and edges) return in a query. Default is 1000
	SetPreFetchSize(size int) TGError
	// GetTraversalDepth gets the current value of traversal depth
	GetTraversalDepth() int
	// SetTraversalDepth sets the additional level of traversal from the query result set. Default is 3.
	SetTraversalDepth(depth int) TGError
	// GetEdgeLimit gets the current value of edge limit
	GetEdgeLimit() int
	// SetEdgeLimit sets the number of edges per node to be returned in a query.  Default is 0 which means unlimited.
	SetEdgeLimit(limit int) TGError
	// GetSortAttrName gets sort attribute name
	GetSortAttrName() string
	// SetSortAttrName sets sort attribute name
	SetSortAttrName(name string) TGError
	// IsSortOrderDsc gets sort order desc
	IsSortOrderDsc() bool
	// SetSortOrderDsc sets sort order desc
	SetSortOrderDsc(isDsc bool) TGError
	// GetSortResultLimit gets sort result limit
	GetSortResultLimit() int
	// SetSortResultLimit sets sort result limit
	SetSortResultLimit(limit int) TGError
	// Additional Method to help debugging
	String() string
}

A Set of QueryOption that allows the user manipulate the results of the query

type TGResultDataDescriptor

type TGResultDataDescriptor interface {
	GetDataType() int
	GetContainedDataSize() int
	IsMap() bool
	IsArray() bool
	HasConcreteType() bool
	GetScalarType() int //TGAttributeType
	GetSystemObject() TGSystemObject
	GetKeyDescriptor() TGResultDataDescriptor
	GetValueDescriptor() TGResultDataDescriptor
	GetContainedDescriptors() []TGResultDataDescriptor
	GetContainedDescriptor(position int) TGResultDataDescriptor
}

type TGResultSet

type TGResultSet interface {
	// AddEntityToResultSet adds another entity to the result set
	AddEntityToResultSet(entity TGEntity) TGResultSet
	// Close closes the result set
	Close() TGResultSet
	// Count returns nos of entities returned by the query. The result set has a cursor which prefetches
	// "n" rows as per the query constraint. If the nos of entities returned by the query is less
	// than prefetch count, then all are returned.
	Count() int
	// First returns the first entity in the result set
	First() interface{}
	// Last returns the last Entity in the result set
	Last() interface{}
	// GetAt gets the entity at the position.
	GetAt(position int) interface{}
	// GetExceptions gets the Exceptions in the result set
	GetExceptions() []TGError
	// GetPosition gets the Current cursor position. A result set upon creation is set to the position 0.
	GetPosition() int
	// HasExceptions checks whether the result set has any exceptions
	HasExceptions() bool
	// HasNext Check whether there is next entry in result set
	HasNext() bool
	// Next returns the next entity w.r.t to the current cursor position in the result set
	Next() interface{}
	// Prev returns the prev entity w.r.t to the current cursor position in the result set
	Prev() interface{}
	// Skip skips a number of position
	Skip(position int) TGResultSet
	// Additional Method to help debugging
	String() string
	// ToCollection converts the result set into a collection
	ToCollection() []interface{}

	GetMetadata() TGResultSetMetaData
}

type TGResultSetMetaData

type TGResultSetMetaData interface {
	GetResultDataDescriptor() *TGResultDataDescriptor
	GetResultType() int
	GetAnnot() string
}

type TGSerializable

type TGSerializable interface {
	// ReadExternal reads the byte format from an external input stream and constructs a system object
	ReadExternal(iStream TGInputStream) TGError
	// WriteExternal writes a system object into an appropriate byte format onto an external output stream
	WriteExternal(oStream TGOutputStream) TGError
}

type TGServerInfo

type TGServerInfo interface {
	// GetCacheInfo returns cache statistics information from server
	GetCacheInfo() TGCacheStatistics
	// GetDatabaseInfo returns database statistics information from server
	GetDatabaseInfo() TGDatabaseStatistics
	// GetMemoryInfo returns object corresponding to specific memory type
	GetMemoryInfo(memType MemType) TGMemoryInfo
	// GetNetListenersInfo returns a collection of information on NetListeners
	GetNetListenersInfo() []TGNetListenerInfo
	// GetServerStatus returns the information on Server Status including name, version etc.
	GetServerStatus() TGServerStatus
	// GetTransactionsInfo returns transaction statistics from server including processed transaction count, successful transaction count, average processing time etc.
	GetTransactionsInfo() TGTransactionStatistics
}

TGServerInfo allows users to retrieve the Server Information; this includes the server status, collection of net-listener objects, information on server-memory, information on transaction-statistics, cache-statistics, and database information

type TGServerMemoryInfo

type TGServerMemoryInfo interface {
	// GetMemoryInfo returns the memory info for the specified type
	GetServerMemoryInfo(memType MemType) TGMemoryInfo
}

TGServerMemoryInfo allows users to retrieve the Server-Process-Memory or Server-Shared-Memory Information

type TGServerStatus

type TGServerStatus interface {
	// GetName returns the name of the server instance
	GetName() string
	// GetProcessId returns the process ID of server
	GetProcessId() string
	// GetServerStatus returns the state information of server
	GetServerStatus() ServerStates
	// GetUptime returns the uptime information of server
	GetUptime() time.Duration
}

TGServerStatus allows users to retrieve the status of server

type TGSystemObject

type TGSystemObject interface {
	TGSerializable
	// GetName gets the system object's name
	GetName() string
	// GetSystemType gets the system object's type
	GetSystemType() TGSystemType
}

type TGSystemType

type TGSystemType int

======= System Types =======

const (
	SystemTypeInvalid TGSystemType = -1
	SystemTypeEntity  TGSystemType = -2
)
const (
	SystemTypeAttributeDescriptor TGSystemType = iota
	SystemTypeNode
	SystemTypeEdge
	SystemTypeIndex
	SystemTypePrincipal
	SystemTypeRole
	SystemTypeSequence
	SystemTypeMaxSysObject
)

func (TGSystemType) String

func (systemType TGSystemType) String() string

type TGTracer

type TGTracer interface {
	// Start starts the channel tracer
	Start()
	// Stop stops the channel tracer
	Stop()
	// Trace traces the path the message has taken
	Trace(msg TGMessage)
}

type TGTransaction

type TGTransaction interface {
	TGSerializable
	String() string
}

type TGTransactionStatistics

type TGTransactionStatistics interface {
	// GetAverageProcessingTime returns the average processing time for the transactions
	GetAverageProcessingTime() float64
	// GetPendingTransactionsCount returns the pending transactions count
	GetPendingTransactionsCount() int64
	// GetTransactionLoggerQueueDepth returns the queue depth of transactionLogger
	GetTransactionLoggerQueueDepth() int
	// GetTransactionProcessorsCount returns the transaction processors count
	GetTransactionProcessorsCount() int64
	// GetTransactionProcessedCount returns the processed transaction count
	GetTransactionProcessedCount() int64
	// GetTransactionSuccessfulCount returns the successful transactions count
	GetTransactionSuccessfulCount() int64
}

TGTransactionStatistics allows users to retrieve the transaction statistics from server

type TGTransactionStatus

type TGTransactionStatus int

======= Various Transaction Status Returned from TGDB server =======

const (
	TGTransactionInvalid                          TGTransactionStatus = -1
	TGTransactionSuccess                          TGTransactionStatus = 0
	TGTransactionAlreadyInProgress                TGTransactionStatus = lastStatus + 1
	TGTransactionClientDisconnected               TGTransactionStatus = lastStatus + 2
	TGTransactionMalFormed                        TGTransactionStatus = lastStatus + 3
	TGTransactionGeneralError                     TGTransactionStatus = lastStatus + 4
	TGTransactionVerificationError                TGTransactionStatus = lastStatus + 5
	TGTransactionInBadState                       TGTransactionStatus = lastStatus + 6
	TGTransactionUniqueConstraintViolation        TGTransactionStatus = lastStatus + 7
	TGTransactionOptimisticLockFailed             TGTransactionStatus = lastStatus + 8
	TGTransactionResourceExceeded                 TGTransactionStatus = lastStatus + 9
	TGCurrentThreadNotInTransaction               TGTransactionStatus = lastStatus + 10
	TGTransactionUniqueIndexKeyAttributeNullError TGTransactionStatus = lastStatus + 11
)

func FromStatus

func FromStatus(status int) TGTransactionStatus

func (TGTransactionStatus) String

func (txnStatus TGTransactionStatus) String() string

type TGTraversalDescriptor

type TGTraversalDescriptor interface {
	// Traverse the graph using starting points provided
	Traverse(startingPoints []TGNode) TGResultSet
}

type TGUserInfo

type TGUserInfo interface {
	// GetName returns the user name
	GetName() string
	// GetSystemId returns the system ID for this user
	GetSystemId() int
	// GetType returns the user type
	GetType() byte
}

TGUserInfo allows users to retrieve the memory information from server

type TypeConnection

type TypeConnection int

======= Various Connection Types =======

const (
	TypeConventional TypeConnection = iota
	TypeAdmin
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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