Documentation
¶
Index ¶
- Constants
- Variables
- func ReadPackedBool(r io.Reader) (bool, error)
- func ReadPackedByte(r io.Reader) (byte, error)
- func ReadPackedBytes(r io.Reader) ([]byte, error)
- func ReadPackedInt(r io.Reader) (int64, error)
- func ReadPackedInt8(r io.Reader) (int8, error)
- func ReadPackedInt16(r io.Reader) (int16, error)
- func ReadPackedInt32(r io.Reader) (int32, error)
- func ReadPackedInt64(r io.Reader) (int64, error)
- func ReadPackedInt64Array(r io.Reader) ([]int64, error)
- func ReadPackedInt64String(r io.Reader) (int64, string, error)
- func ReadPackedString(r io.Reader) (string, error)
- func ReadPackedTimestamp(r io.Reader) (time.Time, error)
- func ReadPackedUint8(r io.Reader) (uint8, error)
- func ReadRawByteArray(r io.Reader, len int) ([]byte, error)
- func TryReadError(r io.Reader) (interface{}, error)
- func TryReadPackedIntWithDefault(r io.Reader, defaultValue int64) (int64, error)
- func TryReadPackedNil(r io.Reader) (bool, error)
- func WritePackedByte(w io.Writer, v byte) error
- func WritePackedBytes(w io.Writer, v []byte) error
- func WritePackedInt64(w io.Writer, v int64) error
- func WritePackedMap(w io.Writer, code map[string]string) error
- func WritePackedNull(w io.Writer) error
- func WritePackedString(w io.Writer, v string) error
- func WritePackedTimestamp(w io.Writer, ts time.Time) error
- func WritePackedUUID(w io.Writer, v Uuid) error
- func WriteRawByte(w io.Writer, v byte) error
- func WriteRawBytes(w io.Writer, v []byte) error
- func WriteRawInt8(w io.Writer, v int8) error
- func WriteRawInt32(w io.Writer, v int32) error
- type Char
- type Client
- type ClientDirectTxMode
- type ClientPartitionAwarenessMetadata
- type Column
- type ColumnMetadata
- type ColumnOrigin
- type ColumnType
- type ColumnTypes
- func (c ColumnTypes) GetColumnTypeById(id int) (*ColumnType, error)
- func (c ColumnTypes) GetKindById(id int) (reflect.Kind, error)
- func (c ColumnTypes) GetKindByName(name string) (reflect.Kind, error)
- func (c ColumnTypes) GetNameById(id int) (string, error)
- func (c ColumnTypes) GetTypeIdByGoKind(name string) (int, error)
- func (c ColumnTypes) GetTypeIdBySQLName(name string) (int, error)
- type ConnInfo
- type Date
- type DateTime
- type Decimal
- type QuerySQLData
- type QuerySQLFieldsData
- type QuerySQLPage
- type QuerySQLResult
- type QueryScanData
- type Request
- type RequestHandshake
- type RequestHeartbeat
- type RequestOperation
- type Response
- type ResponseHandshake
- type ResponseHeartbeat
- type ResponseOperation
- type ResultSetMetadata
- func (r *ResultSetMetadata) GetColumnOriginNameById(index int) (string, error)
- func (r *ResultSetMetadata) GetColumnPrecisionById(index int) (int, error)
- func (r *ResultSetMetadata) GetColumnScaleById(index int) (int, error)
- func (r *ResultSetMetadata) GetColumnTypeById(index int) (*ColumnType, error)
- func (r *ResultSetMetadata) GetSchemaOriginNameById(index int) (string, error)
- func (r *ResultSetMetadata) GetTableOriginNameById(index int) (string, error)
- func (r *ResultSetMetadata) IndexOf(column string) int
- func (rs *ResultSetMetadata) NewColumnMetadataFromReader(r io.Reader, index int) error
- func (rs *ResultSetMetadata) NewColumnOriginFromReaderWithDefault(r io.Reader, columnName string) (*ColumnOrigin, error)
- type Schema
- type Time
- type Timestamp
- type Tuple
- type Uuid
Constants ¶
const ( UNDEFINED_PRECISION = -1 UNDEFINED_SCALE = math.MinInt )
const ( OpHeartbeat = 1 OpTablesGet = 3 OpTableGet = 4 OpSchemaGet = 5 OpTupleUpsert = 10 OpTupleGet = 12 OpTupleUpsertAll = 13 OpTupleGetAll = 15 OpTupleGetAndUpsert = 16 OpTupleInsert = 18 OpTupleInsertAll = 20 OpTupleReplace = 22 OpTupleReplaceExact = 24 OpTupleGetAndReplace = 26 OpTupleDelete = 28 OpTupleDeleteAll = 29 OpTupleDeleteExact = 30 OpTupleDeleteAllExact = 31 OpTupleGetAndDelete = 32 OpTupleContainsKey = 33 OpJdbcTableMeta = 38 OpJdbcColumnMeta = 39 OpJdbcPKMeta = 41 OpTxBegin = 43 OpTxCommit = 44 OpTxRollback = 45 OpComputeExecute = 47 OpClusterGetNodes = 48 OpComputeExecuteCollocated = 49 OpSqlExecute = 50 OpSqlCursorNextPage = 51 OpSqlCursorClose = 52 OpSqlExecuteScript = 56 OpSqlQueryMeta = 57 OpComputeGetStatus = 59 OpComputeCancel = 60 OpComputeChangePriority = 61 OpSqlExecuteBatch = 63 OpSqlCancelExecute = 70 OpTablesGetQualified = 71 OpTableGetQualified = 72 )
v3_OK
const ( AuthInfoUsernameLabel = "authn-identity" AuthInfoPasswordLabel = "authn-secret" AuthInfoType = "authn-type" )
const ( // OperationStatusSuccess means success OperationStatusSuccess = 0 FlagPartitionAssignmentChanged = 1 FlagError = 4 )
const (
DEFAULT_SCHEMA = "PUBLIC"
)
const (
// HeartbeatStatusSuccess means success
HeartbeatStatusSuccess = 0
)
const (
MIN_HEARTBEAT_INTERVAL_MS = 500
)
Variables ¶
var ( // TODO: Are we? PartitionAwareness bool Debug = false )
var ( ColTypes = ColumnTypes{ ColumnType{ SQLTypeName: "NULL", TypeId: typeNULL, GoKind: reflect.Pointer, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "BOOLEAN", TypeId: 1, GoKind: typeBOOLEAN, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "TINYINT", TypeId: typeTINYINT, GoKind: reflect.Int8, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "SMALLINT", TypeId: typeSMALLINT, GoKind: reflect.Int16, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "INT", TypeId: typeINT, GoKind: reflect.Int32, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "BIGINT", TypeId: typeBIGINT, GoKind: reflect.Int64, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "REAL", TypeId: typeREAL, GoKind: reflect.Float32, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "DOUBLE", TypeId: typeDOUBLE, GoKind: reflect.Float64, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "DECIMAL", TypeId: typeDECIMAL, GoKind: reflect.Struct, PrecisionAllowed: true, ScaleAllowed: true, LengthAllowed: false, }, ColumnType{ SQLTypeName: "DATE", TypeId: typeDATE, GoKind: reflect.Int, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "TIME", TypeId: typeTIME, GoKind: reflect.Int, PrecisionAllowed: true, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "DATETIME", TypeId: typeDATETIME, GoKind: reflect.Struct, PrecisionAllowed: true, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "TIMESTAMP", TypeId: typeTIMESTAMP, GoKind: reflect.Struct, PrecisionAllowed: true, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "UUID", TypeId: typeUUID, GoKind: reflect.Struct, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: false, }, ColumnType{ SQLTypeName: "VARCHAR", TypeId: typeVARCHAR, GoKind: reflect.String, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: true, }, ColumnType{ SQLTypeName: "VARBINARY", TypeId: typeVARBINARY, GoKind: reflect.Array, PrecisionAllowed: false, ScaleAllowed: false, LengthAllowed: true, }, } )
var MAGIC_BYTES = []byte{0x49, 0x47, 0x4E, 0x49}
Functions ¶
func ReadPackedTimestamp ¶
ReadTimestamp reads "Timestamp" object value
func ReadRawByteArray ¶
ReadRawArrayBytes reads len bytes array value
func TryReadError ¶
v3_WIP : NOK quand il y a un msg d'erreur (a provoquer en mettant une version incompatible au handshake)
func TryReadPackedIntWithDefault ¶
Try to read Int. If Int found, reader is advanced to next message. If not Int, reader is not advanced and defaultValue is returned
func TryReadPackedNil ¶
Try to read Nil. If Nil, reader is advanced to next message. If not nil, reader is not advanced
func WritePackedMap ¶
WriteMap writes map type code
func WritePackedNull ¶
func WritePackedString ¶
WriteString writes "string" value
func WritePackedUUID ¶
WriteOUUID writes "UUID" object value as msgpack ext 3
func WriteRawBytes ¶
WriteBytes writes byte slice raw, not encoded
Types ¶
type Client ¶
type Client interface {
// Connected return true if connection to the cluster is active
Connected() bool
// Do sends request and receives response
Do(req Request, res Response) error
// Close closes connection.
// Returns:
// nil in case of success.
// error object in case of error.
Close() error
SendHeartbeat() error
GetTables() (map[int64]string, error)
GetTable(table string) error
// CacheCreateWithName Creates a cache with a given name.
// Cache template can be applied if there is a '*' in the cache name.
// https://apacheignite.readme.io/docs/binary-client-protocol-cache-configuration-operations#section-op_cache_create_with_name
CacheCreateWithName(cache string) error
// CacheGetOrCreateWithName creates a cache with a given name.
// Cache template can be applied if there is a '*' in the cache name.
// Does nothing if the cache exists.
// https://apacheignite.readme.io/docs/binary-client-protocol-cache-configuration-operations#section-op_cache_get_or_create_with_name
CacheGetOrCreateWithName(cache string) error
// CacheGetNames returns existing cache names.
// https://apacheignite.readme.io/docs/binary-client-protocol-cache-configuration-operations#section-op_cache_get_names
CacheGetNames() ([]string, error)
// CacheDestroy destroys cache with a given name.
// https://apacheignite.readme.io/docs/binary-client-protocol-cache-configuration-operations#section-op_cache_destroy
CacheDestroy(cache string) error
// CacheGet retrieves a value from cache by key.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get
CacheGet(cache string, binary bool, key interface{}) (interface{}, error)
// CacheGetAll retrieves multiple key-value pairs from cache.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_all
CacheGetAll(cache string, binary bool, keys []interface{}) (map[interface{}]interface{}, error)
// CachePut puts a value with a given key to cache (overwriting existing value if any).
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_put
CachePut(cache string, binary bool, key interface{}, value interface{}) error
// CachePutAll puts a value with a given key to cache (overwriting existing value if any).
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_put_all
CachePutAll(cache string, binary bool, data map[interface{}]interface{}) error
// CacheContainsKey returns a value indicating whether given key is present in cache.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_contains_key
CacheContainsKey(cache string, binary bool, key interface{}) (bool, error)
// CacheContainsKeys returns a value indicating whether all given keys are present in cache.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_contains_keys
CacheContainsKeys(cache string, binary bool, keys []interface{}) (bool, error)
// CacheGetAndPut puts a value with a given key to cache, and returns the previous value for that key.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_and_put
CacheGetAndPut(cache string, binary bool, key interface{}, value interface{}) (interface{}, error)
// CacheGetAndReplace puts a value with a given key to cache, returning previous value for that key,
// if and only if there is a value currently mapped for that key.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_and_replace
CacheGetAndReplace(cache string, binary bool, key interface{}, value interface{}) (interface{}, error)
// CacheGetAndRemove removes the cache entry with specified key, returning the value.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_and_remove
CacheGetAndRemove(cache string, binary bool, key interface{}) (interface{}, error)
// CachePutIfAbsent puts a value with a given key to cache only if the key does not already exist.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_put_if_absent
CachePutIfAbsent(cache string, binary bool, key interface{}, value interface{}) (bool, error)
// CacheGetAndPutIfAbsent puts a value with a given key to cache only if the key does not already exist.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_and_put_if_absent
CacheGetAndPutIfAbsent(cache string, binary bool, key interface{}, value interface{}) (interface{}, error)
// CacheReplace puts a value with a given key to cache only if the key already exists.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_replace
CacheReplace(cache string, binary bool, key interface{}, value interface{}) (bool, error)
// CacheReplaceIfEquals puts a value with a given key to cache only if
// the key already exists and value equals provided value.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_replace_if_equals
CacheReplaceIfEquals(cache string, binary bool, key interface{}, valueCompare interface{}, valueNew interface{}) (bool, error)
// CacheClear clears the cache without notifying listeners or cache writers.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_clear
CacheClear(cache string, binary bool) error
// CacheClearKey clears the cache key without notifying listeners or cache writers.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_clear_key
CacheClearKey(cache string, binary bool, key interface{}) error
// CacheClearKeys clears the cache keys without notifying listeners or cache writers.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_clear_keys
CacheClearKeys(cache string, binary bool, keys []interface{}) error
// CacheRemoveKey removes an entry with a given key, notifying listeners and cache writers.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_remove_key
CacheRemoveKey(cache string, binary bool, key interface{}) (bool, error)
// CacheRemoveIfEquals removes an entry with a given key if provided value is equal to actual value,
// notifying listeners and cache writers.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_remove_if_equals
CacheRemoveIfEquals(cache string, binary bool, key interface{}, value interface{}) (bool, error)
// CacheGetSize gets the number of entries in cache.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_get_size
CacheGetSize(cache string, binary bool, modes []byte) (int64, error)
// CacheRemoveKeys removes entries with given keys, notifying listeners and cache writers.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_remove_keys
CacheRemoveKeys(cache string, binary bool, keys []interface{}) error
// CacheRemoveAll destroys cache with a given name.
// https://apacheignite.readme.io/docs/binary-client-protocol-key-value-operations#section-op_cache_remove_all
CacheRemoveAll(cache string, binary bool) error
// QuerySQL executes an SQL query over data stored in the cluster. The query returns the whole record (key and value).
QuerySQL(data QuerySQLData) (QuerySQLResult, error)
// QuerySQLCursorGetPage retrieves the next SQL query cursor page by cursor id from QuerySQL.
// It needs the schema (we find it embedded in the metadata of original query)
QuerySQLCursorGetPage(id int64, metadata *ResultSetMetadata) (QuerySQLResult, error)
// QuerySQLFieldsRaw is equal to QuerySQLFields but return raw Response object.
// Used for SQL driver to reduce memory allocations.
QuerySQLFieldsRaw(data QuerySQLFieldsData) (*ResponseOperation, error)
// QuerySQLFields performs SQL fields query.
// https://apacheignite.readme.io/docs/binary-client-protocol-sql-operations#section-op_query_sql_fields
QuerySQLFields(data QuerySQLFieldsData) (QuerySQLResult, error)
// QuerySQLFieldsCursorGetPageRaw is equal to QuerySQLFieldsCursorGetPage but return raw Response object.
// Used for SQL driver to reduce memory allocations.
QuerySQLFieldsCursorGetPageRaw(id int64) (*ResponseOperation, error)
// ResourceClose closes a resource, such as query cursor.
// https://apacheignite.readme.io/docs/binary-client-protocol-sql-operations#section-op_resource_close
ResourceClose(id int64) error
}
Client is interface to communicate with Apache Ignite cluster. Client is thread safe.
type ClientDirectTxMode ¶
type ClientDirectTxMode uint8
const ( ClientDirectTxModeNotSupported ClientDirectTxMode = iota ClientDirectTxModeSupported ClientDirectTxModeSupportedTrackingRequired )
func NewClientDirectTxModeFromByte ¶
func NewClientDirectTxModeFromByte(val uint8) ClientDirectTxMode
type ClientPartitionAwarenessMetadata ¶
type ClientPartitionAwarenessMetadata struct {
TableId int
Indexes []int
Hash []int
DirectTxMode ClientDirectTxMode
}
func NewClientPartitionAwarenessMetadataFromReader ¶
func NewClientPartitionAwarenessMetadataFromReader(r io.Reader, sqlDirectMappingSupported bool) (*ClientPartitionAwarenessMetadata, error)
func ReadPartitionAwareness ¶
func ReadPartitionAwareness(response *ResponseOperation, partAwareness bool, sqlDMSupported bool) (*ClientPartitionAwarenessMetadata, error)
type Column ¶
type Column struct {
Name string
}
Schema minimal : ordre des colonnes (+ types si nécessaire)
type ColumnMetadata ¶
type ColumnMetadata struct {
Name string
Nullable bool
//Class<?> valueClass();
Type *ColumnType // See columnType.java
Precision int
Scale int
Index int
Origin *ColumnOrigin
}
func (*ColumnMetadata) ToJsonString ¶
func (c *ColumnMetadata) ToJsonString() string
type ColumnOrigin ¶
*
- Represents a column origin. *
- <p>Example:
- <pre>
- SELECT SUM(price), category as cat, subcategory AS subcategory
- FROM Goods
- WHERE [condition]
- GROUP BY cat, subcategory
- </pre> *
- <p>Column origins:
- <ul>
- <li>SUM(price): null</li>
- <li>cat: {"PUBLIC", "Goods", "category"}</li>
- <li>subcategory: {"PUBLIC", "Goods", "subcategory"}</li>
- </ul>
func (*ColumnOrigin) ToJsonString ¶
func (c *ColumnOrigin) ToJsonString() string
type ColumnType ¶
type ColumnTypes ¶
type ColumnTypes []ColumnType
func (ColumnTypes) GetColumnTypeById ¶
func (c ColumnTypes) GetColumnTypeById(id int) (*ColumnType, error)
func (ColumnTypes) GetKindById ¶
func (c ColumnTypes) GetKindById(id int) (reflect.Kind, error)
func (ColumnTypes) GetKindByName ¶
func (c ColumnTypes) GetKindByName(name string) (reflect.Kind, error)
func (ColumnTypes) GetNameById ¶
func (c ColumnTypes) GetNameById(id int) (string, error)
func (ColumnTypes) GetTypeIdByGoKind ¶
func (c ColumnTypes) GetTypeIdByGoKind(name string) (int, error)
func (ColumnTypes) GetTypeIdBySQLName ¶
func (c ColumnTypes) GetTypeIdBySQLName(name string) (int, error)
type ConnInfo ¶
type ConnInfo struct {
Network, Host string
Port int
Major, Minor, Patch int
Username, Password string
Dialer net.Dialer
TLSConfig *tls.Config
}
ConnInfo contains connections parameters
type Decimal ¶
type QuerySQLData ¶
type QuerySQLData struct {
// Schema for the query
Schema string
// SQL query string.
Query string
// Query arguments.
QueryArgs []interface{}
// Cursor page size.
PageSize int
// Timeout(milliseconds) value should be non-negative. Zero value disables timeout.
Timeout int64
}
QuerySQLData input parameter for QuerySQL func
type QuerySQLFieldsData ¶
type QuerySQLFieldsData struct {
// Schema for the query; can be empty, in which case default PUBLIC schema will be used.
Schema string
// Query cursor page size.
PageSize int
// SQL query string.
Query string
// Query arguments.
QueryArgs []interface{}
// Timeout(milliseconds) value should be non-negative. Zero value disables timeout.
Timeout int64
}
QuerySQLFieldsData input parameter for QuerySQLFields func
type QuerySQLPage ¶
type QuerySQLPage struct {
// Key -> Values
Rows map[int]interface{}
// Indicates whether more results are available to be fetched with QuerySQLCursorGetPage.
// When false, query cursor is closed automatically.
HasMore bool
}
QuerySQLPage is query result page
type QuerySQLResult ¶
type QuerySQLResult struct {
// Cursor id. Can be closed with ResourceClose func.
ResponseId int64
ResourceId int64
Metadata *ResultSetMetadata
HasRowSet bool
AffectedRows int64
// Query result first page
QuerySQLPage
// contains filtered or unexported fields
}
QuerySQLResult output from QuerySQL func
func ReadQuerySQLResponseHeader ¶
func ReadQuerySQLResponseHeader(result QuerySQLResult, response *ResponseOperation) (QuerySQLResult, error)
type QueryScanData ¶
type QueryScanData struct {
// Cursor page size.
PageSize int
// Number of partitions to query (negative to query entire cache).
Partitions int
// Local flag - whether this query should be executed on local node only.
LocalQuery bool
}
QueryScanData input parameter for QueryScan func
type Request ¶
type Request interface {
// WriteTo is function to write request data to io.Writer.
// Returns written bytes.
WriteTo(w io.Writer) (int64, error)
}
Request is interface of base message request functionality
type RequestHandshake ¶
type RequestHandshake struct {
// contains filtered or unexported fields
}
RequestHandshake is struct handshake request
func NewRequestHandshake ¶
func NewRequestHandshake(major, minor, patch int, username, password string) *RequestHandshake
NewRequestHandshake creates new handshake request object Only basic authentication supported
func (*RequestHandshake) Write ¶
Write writes len(p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= len(p)) and any error encountered that caused the write to stop early. Write must return a non-nil error if it returns n < len(p). Write must not modify the slice data, even temporarily.
Implementations must not retain p.
type RequestHeartbeat ¶
RequestHandshake is struct handshake request
func NewRequestHeartbeat ¶
func NewRequestHeartbeat(id int64) *RequestHeartbeat
NewRequestHeartbeat creates new heartbeat request object
func (*RequestHeartbeat) Write ¶
Write writes len(p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= len(p)) and any error encountered that caused the write to stop early. Write must return a non-nil error if it returns n < len(p). Write must not modify the slice data, even temporarily.
Implementations must not retain p.
type RequestOperation ¶
type RequestOperation struct {
Code int16
RequestId int64
SpecificData []byte
// contains filtered or unexported fields
}
RequestOperation is struct to store operation request
func NewRequestOperation ¶
func NewRequestOperation(code int16, requestId int64, payload []byte) *RequestOperation
NewRequestOperation creates new handshake request object
func (*RequestOperation) Write ¶
Write writes len(p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= len(p)) and any error encountered that caused the write to stop early. Write must return a non-nil error if it returns n < len(p). Write must not modify the slice data, even temporarily.
Implementations must not retain p.
type Response ¶
type Response interface {
// ReadFrom is function to read request data from io.Reader.
// Returns read bytes.
ReadFrom(r *bufio.Reader) (int64, error)
}
Response is interface of base message response functionality
type ResponseHandshake ¶
type ResponseHandshake struct {
// Success flag
Success bool
// Server version major, minor, patch
Major, Minor, Patch int
ErrorUuid Uuid
ErrorMessage string
ErrorStackTrace string
ErrorDetails string
ClientType int8
IdleTimeout int64
ClusterNodeId Uuid
ClusterNodeName string
ClusterIdsCount uint8
ClusterIds []Uuid
ClusterName string
ObservableTS int64
DBMSVerMajor uint8
DBMSVerMinor uint8
DBMSVerMaintenance uint8
DBMSVerPatch string
DBMSVerPreRelease string
Features []byte // FIXME
// contains filtered or unexported fields
}
ResponseHandshake is struct handshake response. It is the only response to have MAGIC_BYTES header
func (*ResponseHandshake) Read ¶
Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. Even if Read returns n < len(p), it may use all of p as scratch space during the call. If some data is available but not len(p) bytes, Read conventionally returns what is available instead of waiting for more.
type ResponseHeartbeat ¶
type ResponseHeartbeat struct {
// Request id
UID int64
// Status code (0 for success, otherwise error code)
Status int32
// What is this data?
UnknownData int64
// contains filtered or unexported fields
}
ResponseOperation is struct operation response
func NewResponseHeartbeat ¶
func NewResponseHeartbeat(uid int64) *ResponseHeartbeat
NewResponseOperation is ResponseHeartbeat constructor
func (*ResponseHeartbeat) CheckStatus ¶
func (r *ResponseHeartbeat) CheckStatus() error
CheckStatus checks status of operation execution. Returns: nil in case of success. error object in case of operation failed.
func (*ResponseHeartbeat) Read ¶
Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. Even if Read returns n < len(p), it may use all of p as scratch space during the call. If some data is available but not len(p) bytes, Read conventionally returns what is available instead of waiting for more.
type ResponseOperation ¶
type ResponseOperation struct {
// Request id
RequestId int64
// Status code (0 for success, otherwise error code)
Flags int32
// Observable Timestamp (causality token)
ObsTs time.Time
// Error message (present only when status is not 0)
Code int64
Uuid Uuid
Message string
Details string
// Copie des données restantes, pour comprendre pourquoi j'ai un EOF :
// ping failed: failed to execute ping query: failed to read result set column metadata: failed to read result set column property count: EOF
Data bytes.Buffer
// contains filtered or unexported fields
}
ResponseOperation is struct operation response
func NewResponseOperation ¶
func NewResponseOperation(uid int64) *ResponseOperation
NewResponseOperation is ResponseOperation constructor
func (*ResponseOperation) CheckStatus ¶
func (r *ResponseOperation) CheckStatus() error
CheckStatus checks status of operation execution. Returns: nil in case of success. error object in case of operation failed.
func (*ResponseOperation) GetMessage ¶
func (r *ResponseOperation) GetMessage() io.Reader
GRUIIKKK TODO: REMOVE ME
func (*ResponseOperation) Read ¶
Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. Even if Read returns n < len(p), it may use all of p as scratch space during the call. If some data is available but not len(p) bytes, Read conventionally returns what is available instead of waiting for more.
type ResultSetMetadata ¶
type ResultSetMetadata struct {
Columns []ColumnMetadata
}
func NewResultSetMetadataFromReader ¶
func NewResultSetMetadataFromReader(r io.Reader) (*ResultSetMetadata, error)
func (*ResultSetMetadata) GetColumnOriginNameById ¶
func (r *ResultSetMetadata) GetColumnOriginNameById(index int) (string, error)
func (*ResultSetMetadata) GetColumnPrecisionById ¶
func (r *ResultSetMetadata) GetColumnPrecisionById(index int) (int, error)
func (*ResultSetMetadata) GetColumnScaleById ¶
func (r *ResultSetMetadata) GetColumnScaleById(index int) (int, error)
func (*ResultSetMetadata) GetColumnTypeById ¶
func (r *ResultSetMetadata) GetColumnTypeById(index int) (*ColumnType, error)
func (*ResultSetMetadata) GetSchemaOriginNameById ¶
func (r *ResultSetMetadata) GetSchemaOriginNameById(index int) (string, error)
func (*ResultSetMetadata) GetTableOriginNameById ¶
func (r *ResultSetMetadata) GetTableOriginNameById(index int) (string, error)
func (*ResultSetMetadata) IndexOf ¶
func (r *ResultSetMetadata) IndexOf(column string) int
func (*ResultSetMetadata) NewColumnMetadataFromReader ¶
func (rs *ResultSetMetadata) NewColumnMetadataFromReader(r io.Reader, index int) error
func (*ResultSetMetadata) NewColumnOriginFromReaderWithDefault ¶
func (rs *ResultSetMetadata) NewColumnOriginFromReaderWithDefault(r io.Reader, columnName string) (*ColumnOrigin, error)
type Tuple ¶
Ref modules/binary-tuple/src/main/java/org/apache/ignite/internal/binarytuple/BinaryTupleBuilder.java
func NewTupleFromByteArrayWithMetadata ¶
func NewTupleFromByteArrayWithMetadata(meta *ResultSetMetadata, bufr []byte) (*Tuple, error)
type Uuid ¶
func ReadPackedUUID ¶
ReadUUID reads "UUID" object value
func (*Uuid) FromString ¶
func (*Uuid) MarshalMsgpack ¶
func (*Uuid) UnmarshalMsgpack ¶
Prend en entree les donnees brutes, sans l'entete msgpack