wrapper

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 13 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Int8Size    = unsafe.Sizeof(int8(0))
	Int16Size   = unsafe.Sizeof(int16(0))
	Int32Size   = unsafe.Sizeof(int32(0))
	Int64Size   = unsafe.Sizeof(int64(0))
	UInt8Size   = unsafe.Sizeof(uint8(0))
	UInt16Size  = unsafe.Sizeof(uint16(0))
	UInt32Size  = unsafe.Sizeof(uint32(0))
	UInt64Size  = unsafe.Sizeof(uint64(0))
	Float32Size = unsafe.Sizeof(float32(0))
	Float64Size = unsafe.Sizeof(float64(0))
)
View Source
const (
	ColInfoSize            = Int8Size + Int32Size
	RawBlockVersionOffset  = 0
	RawBlockLengthOffset   = RawBlockVersionOffset + Int32Size
	NumOfRowsOffset        = RawBlockLengthOffset + Int32Size
	NumOfColsOffset        = NumOfRowsOffset + Int32Size
	HasColumnSegmentOffset = NumOfColsOffset + Int32Size
	GroupIDOffset          = HasColumnSegmentOffset + Int32Size
	ColInfoOffset          = GroupIDOffset + UInt64Size
)
View Source
const (
	InfluxDBLineProtocol       = 1
	OpenTSDBTelnetLineProtocol = 2
	OpenTSDBJsonFormatProtocol = 3
)
View Source
const (
	TSDB_SML_TIMESTAMP_NOT_CONFIGURED = iota
	TSDB_SML_TIMESTAMP_HOURS
	TSDB_SML_TIMESTAMP_MINUTES
	TSDB_SML_TIMESTAMP_SECONDS
	TSDB_SML_TIMESTAMP_MILLI_SECONDS
	TSDB_SML_TIMESTAMP_MICRO_SECONDS
	TSDB_SML_TIMESTAMP_NANO_SECONDS
)
View Source
const (
	PointerSize = unsafe.Sizeof(uintptr(1))
)

Variables

This section is empty.

Functions

func BMIsNull

func BMIsNull(c byte, n int) bool

func BitPos

func BitPos(n int) int

func BitmapLen

func BitmapLen(n int) int

func BuildRawMeta

func BuildRawMeta(length uint32, metaType uint16, data unsafe.Pointer) unsafe.Pointer

func CharOffset

func CharOffset(n int) int

func FetchLengths

func FetchLengths(res unsafe.Pointer, count int) []int

func FetchRawBlockCallback

func FetchRawBlockCallback(p unsafe.Pointer, res *C.TAOS_RES, numOfRows C.int)

func FetchRow

func FetchRow(row unsafe.Pointer, offset int, colType uint8, length int, arg ...interface{}) driver.Value

func FetchRowsCallback

func FetchRowsCallback(p unsafe.Pointer, res *C.TAOS_RES, numOfRows C.int)

func IsVarDataType

func IsVarDataType(colType uint8) bool

func ItemIsNull

func ItemIsNull(pHeader uintptr, row int) bool

func ItemRawBlock

func ItemRawBlock(colType uint8, pHeader, pStart uintptr, row int, precision int, timeFormat FormatTimeFunc) driver.Value

func ParseJsonMeta

func ParseJsonMeta(jsonMeta unsafe.Pointer) []byte

func ParseRawMeta

func ParseRawMeta(rawMeta unsafe.Pointer) (length uint32, metaType uint16, data unsafe.Pointer)

func PutTMQCommitCallbackResult

func PutTMQCommitCallbackResult(result *TMQCommitCallbackResult)

func QueryCallback

func QueryCallback(p unsafe.Pointer, res *C.TAOS_RES, code C.int)

func RawBlockGetColDataOffset

func RawBlockGetColDataOffset(colCount int) uintptr

func RawBlockGetColInfo

func RawBlockGetColInfo(rawBlock unsafe.Pointer, infos []RawBlockColInfo)

func RawBlockGetColumnLengthOffset

func RawBlockGetColumnLengthOffset(colCount int) uintptr

func RawBlockGetGroupID

func RawBlockGetGroupID(rawBlock unsafe.Pointer) uint64

func RawBlockGetHasColumnSegment

func RawBlockGetHasColumnSegment(rawBlock unsafe.Pointer) int32

func RawBlockGetLength

func RawBlockGetLength(rawBlock unsafe.Pointer) int32

func RawBlockGetNumOfCols

func RawBlockGetNumOfCols(rawBlock unsafe.Pointer) int32

func RawBlockGetNumOfRows

func RawBlockGetNumOfRows(rawBlock unsafe.Pointer) int32

func RawBlockGetVersion

func RawBlockGetVersion(rawBlock unsafe.Pointer) int32

func ReadBlock

func ReadBlock(block unsafe.Pointer, blockSize int, colTypes []uint8, precision int) [][]driver.Value

ReadBlock in-place

func ReadBlockWithTimeFormat

func ReadBlockWithTimeFormat(block unsafe.Pointer, blockSize int, colTypes []uint8, precision int, formatFunc FormatTimeFunc) [][]driver.Value

func ReadRow

func ReadRow(dest []driver.Value, block unsafe.Pointer, blockSize int, row int, colTypes []uint8, precision int)

func TMQCommitAsync

func TMQCommitAsync(consumer unsafe.Pointer, message unsafe.Pointer, h cgo.Handle)

TMQCommitAsync DLL_EXPORT void tmq_commit_async(tmq_t *tmq, const TAOS_RES *msg, tmq_commit_cb *cb, void *param);

func TMQCommitCB

func TMQCommitCB(consumer unsafe.Pointer, resp C.int32_t, param unsafe.Pointer)

func TMQCommitSync

func TMQCommitSync(consumer unsafe.Pointer, message unsafe.Pointer) int32

TMQCommitSync DLL_EXPORT int32_t tmq_commit_sync(tmq_t *tmq, const TAOS_RES *msg);

func TMQConfDestroy

func TMQConfDestroy(conf unsafe.Pointer)

TMQConfDestroy void tmq_conf_destroy(tmq_conf_t *conf);

func TMQConfNew

func TMQConfNew() unsafe.Pointer

TMQConfNew tmq_conf_t *tmq_conf_new();

func TMQConfSet

func TMQConfSet(conf unsafe.Pointer, key string, value string) int32

TMQConfSet tmq_conf_res_t tmq_conf_set(tmq_conf_t *conf, const char *key, const char *value);

func TMQConfSetAutoCommitCB

func TMQConfSetAutoCommitCB(conf unsafe.Pointer, h cgo.Handle)

TMQConfSetAutoCommitCB DLL_EXPORT void tmq_conf_set_auto_commit_cb(tmq_conf_t *conf, tmq_commit_cb *cb, void *param);

func TMQConsumerClose

func TMQConsumerClose(consumer unsafe.Pointer) int32

TMQConsumerClose tmq_resp_err_t tmq_consumer_close(tmq_t *tmq);

func TMQConsumerNew

func TMQConsumerNew(conf unsafe.Pointer) (unsafe.Pointer, error)

TMQConsumerNew tmq_t *tmq_consumer_new1(tmq_conf_t *conf, char *errstr, int32_t errstrLen);

func TMQConsumerPoll

func TMQConsumerPoll(consumer unsafe.Pointer, blockingTime int64) unsafe.Pointer

TMQConsumerPoll TAOS_RES *tmq_consumer_poll(tmq_t *tmq, int64_t blocking_time);

func TMQErr2Str

func TMQErr2Str(code int32) string

TMQErr2Str const char *tmq_err2str(int32_t);

func TMQFreeJsonMeta

func TMQFreeJsonMeta(jsonMeta unsafe.Pointer)

TMQFreeJsonMeta DLL_EXPORT void tmq_free_json_meta(char* jsonMeta);

func TMQFreeRaw

func TMQFreeRaw(raw unsafe.Pointer)

TMQFreeRaw DLL_EXPORT void tmq_free_raw(tmq_raw_data raw);

func TMQGetDBName

func TMQGetDBName(message unsafe.Pointer) string

TMQGetDBName const char *tmq_get_db_name(TAOS_RES *res);

func TMQGetJsonMeta

func TMQGetJsonMeta(message unsafe.Pointer) unsafe.Pointer

TMQGetJsonMeta DLL_EXPORT char *tmq_get_json_meta(TAOS_RES *res); // Returning null means error. Returned result need to be freed by tmq_free_json_meta

func TMQGetRaw

func TMQGetRaw(message unsafe.Pointer) (int32, unsafe.Pointer)

TMQGetRaw DLL_EXPORT int32_t tmq_get_raw(TAOS_RES *res, tmq_raw_data *raw);

func TMQGetResType

func TMQGetResType(message unsafe.Pointer) int32

TMQGetResType DLL_EXPORT tmq_res_t tmq_get_res_type(TAOS_RES *res);

func TMQGetTableName

func TMQGetTableName(message unsafe.Pointer) string

TMQGetTableName DLL_EXPORT const char *tmq_get_table_name(TAOS_RES *res);

func TMQGetTopicName

func TMQGetTopicName(message unsafe.Pointer) string

TMQGetTopicName char *tmq_get_topic_name(tmq_message_t *message);

func TMQGetVgroupID

func TMQGetVgroupID(message unsafe.Pointer) int32

TMQGetVgroupID int32_t tmq_get_vgroup_id(tmq_message_t *message);

func TMQListAppend

func TMQListAppend(list unsafe.Pointer, str string) int32

TMQListAppend int32_t tmq_list_append(tmq_list_t *, const char *);

func TMQListDestroy

func TMQListDestroy(list unsafe.Pointer)

TMQListDestroy void tmq_list_destroy(tmq_list_t *);

func TMQListGetSize

func TMQListGetSize(list unsafe.Pointer) int32

TMQListGetSize int32_t tmq_list_get_size(const tmq_list_t *);

func TMQListNew

func TMQListNew() unsafe.Pointer

TMQListNew tmq_list_t *tmq_list_new();

func TMQListToCArray

func TMQListToCArray(list unsafe.Pointer, size int) []string

TMQListToCArray char **tmq_list_to_c_array(const tmq_list_t *);

func TMQSubscribe

func TMQSubscribe(consumer unsafe.Pointer, topicList unsafe.Pointer) int32

TMQSubscribe tmq_resp_err_t tmq_subscribe(tmq_t *tmq, tmq_list_t *topic_list);

func TMQSubscription

func TMQSubscription(consumer unsafe.Pointer) (int32, unsafe.Pointer)

TMQSubscription tmq_resp_err_t tmq_subscription(tmq_t *tmq, tmq_list_t **topics);

func TMQUnsubscribe

func TMQUnsubscribe(consumer unsafe.Pointer) int32

TMQUnsubscribe tmq_resp_err_t tmq_unsubscribe(tmq_t *tmq);

func TMQWriteRaw

func TMQWriteRaw(conn unsafe.Pointer, raw unsafe.Pointer) int32

TMQWriteRaw DLL_EXPORT int32_t tmq_write_raw(TAOS *taos, tmq_raw_data raw);

func TaosAffectedRows

func TaosAffectedRows(result unsafe.Pointer) int

TaosAffectedRows int taos_affected_rows(TAOS_RES *res);

func TaosClose

func TaosClose(taosConnect unsafe.Pointer)

TaosClose void taos_close(TAOS *taos);

func TaosConnect

func TaosConnect(host, user, pass, db string, port int) (taos unsafe.Pointer, err error)

TaosConnect TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port);

func TaosError

func TaosError(result unsafe.Pointer) int

TaosError int taos_errno(TAOS_RES *tres);

func TaosErrorStr

func TaosErrorStr(result unsafe.Pointer) string

TaosErrorStr char *taos_errstr(TAOS_RES *tres);

func TaosFetchBlock

func TaosFetchBlock(result unsafe.Pointer) (int, unsafe.Pointer)

TaosFetchBlock int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows);

func TaosFetchFields

func TaosFetchFields(result unsafe.Pointer) unsafe.Pointer

TaosFetchFields TAOS_FIELD *taos_fetch_fields(TAOS_RES *res);

func TaosFetchLengths

func TaosFetchLengths(res unsafe.Pointer) unsafe.Pointer

TaosFetchLengths int* taos_fetch_lengths(TAOS_RES *res);

func TaosFetchRawBlock

func TaosFetchRawBlock(result unsafe.Pointer) (int, int, unsafe.Pointer)

TaosFetchRawBlock int taos_fetch_raw_block(TAOS_RES *res, int* numOfRows, void** pData);

func TaosFetchRawBlockA

func TaosFetchRawBlockA(res unsafe.Pointer, caller cgo.Handle)

TaosFetchRawBlockA void taos_fetch_raw_block_a(TAOS_RES* res, __taos_async_fn_t fp, void* param);

func TaosFetchRow

func TaosFetchRow(result unsafe.Pointer) unsafe.Pointer

TaosFetchRow TAOS_ROW taos_fetch_row(TAOS_RES *res);

func TaosFetchRowsA

func TaosFetchRowsA(res unsafe.Pointer, caller cgo.Handle)

TaosFetchRowsA void taos_fetch_rows_a(TAOS_RES *res, void (*fp)(void *param, TAOS_RES *, int numOfRows), void *param);

func TaosFieldCount

func TaosFieldCount(result unsafe.Pointer) int

TaosFieldCount int taos_field_count(TAOS_RES *res);

func TaosFreeResult

func TaosFreeResult(res unsafe.Pointer)

TaosFreeResult void taos_free_result(TAOS_RES *res);

func TaosGetClientInfo

func TaosGetClientInfo() string

TaosGetClientInfo const char *taos_get_client_info();

func TaosGetRawBlock

func TaosGetRawBlock(result unsafe.Pointer) unsafe.Pointer

TaosGetRawBlock const void *taos_get_raw_block(TAOS_RES* res);

func TaosIsUpdateQuery

func TaosIsUpdateQuery(res unsafe.Pointer) bool

TaosIsUpdateQuery bool taos_is_update_query(TAOS_RES *res);

func TaosLoadTableInfo

func TaosLoadTableInfo(taosConnect unsafe.Pointer, tableNameList []string) int

TaosLoadTableInfo taos_load_table_info(TAOS *taos, const char* tableNameList);

func TaosNumFields

func TaosNumFields(result unsafe.Pointer) int

TaosNumFields int taos_num_fields(TAOS_RES *res);

func TaosOptions

func TaosOptions(option int, value string) int

TaosOptions int taos_options(TSDB_OPTION option, const void *arg, ...);

func TaosQuery

func TaosQuery(taosConnect unsafe.Pointer, sql string) unsafe.Pointer

TaosQuery TAOS_RES *taos_query(TAOS *taos, const char *sql);

func TaosQueryA

func TaosQueryA(taosConnect unsafe.Pointer, sql string, caller cgo.Handle)

TaosQueryA void taos_query_a(TAOS *taos, const char *sql, void (*fp)(void *param, TAOS_RES *, int code), void *param);

func TaosResetCurrentDB

func TaosResetCurrentDB(taosConnect unsafe.Pointer)

TaosResetCurrentDB void taos_reset_current_db(TAOS *taos);

func TaosResultPrecision

func TaosResultPrecision(result unsafe.Pointer) int

TaosResultPrecision int taos_result_precision(TAOS_RES *res);

func TaosSchemalessInsert

func TaosSchemalessInsert(taosConnect unsafe.Pointer, lines []string, protocol int, precision string) unsafe.Pointer

TaosSchemalessInsert TAOS_RES *taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int protocol, int precision);

func TaosSelectDB

func TaosSelectDB(taosConnect unsafe.Pointer, db string) int

TaosSelectDB int taos_select_db(TAOS *taos, const char *db);

func TaosSetConfig

func TaosSetConfig(params map[string]string) error

TaosSetConfig int taos_set_config(const char *config);

func TaosStmtAddBatch

func TaosStmtAddBatch(stmt unsafe.Pointer) int

TaosStmtAddBatch int taos_stmt_add_batch(TAOS_STMT *stmt);

func TaosStmtAffectedRows

func TaosStmtAffectedRows(stmt unsafe.Pointer) int

TaosStmtAffectedRows int taos_stmt_affected_rows(TAOS_STMT *stmt);

func TaosStmtAffectedRowsOnce

func TaosStmtAffectedRowsOnce(stmt unsafe.Pointer) int

TaosStmtAffectedRowsOnce int taos_stmt_affected_rows_once(TAOS_STMT *stmt);

func TaosStmtBindParam

func TaosStmtBindParam(stmt unsafe.Pointer, params []driver.Value) int

TaosStmtBindParam int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind);

func TaosStmtBindParamBatch

func TaosStmtBindParamBatch(stmt unsafe.Pointer, multiBind [][]driver.Value, bindType []*taosTypes.ColumnType) int

TaosStmtBindParamBatch int taos_stmt_bind_param_batch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind);

func TaosStmtClose

func TaosStmtClose(stmt unsafe.Pointer) int

TaosStmtClose int taos_stmt_close(TAOS_STMT *stmt);

func TaosStmtErrStr

func TaosStmtErrStr(stmt unsafe.Pointer) string

TaosStmtErrStr char *taos_stmt_errstr(TAOS_STMT *stmt);

func TaosStmtExecute

func TaosStmtExecute(stmt unsafe.Pointer) int

TaosStmtExecute int taos_stmt_execute(TAOS_STMT *stmt);

func TaosStmtGetColFields

func TaosStmtGetColFields(stmt unsafe.Pointer) (code, num int, fields unsafe.Pointer)

TaosStmtGetColFields DLL_EXPORT int taos_stmt_get_col_fields(TAOS_STMT *stmt, int* fieldNum, TAOS_FIELD_E** fields);

func TaosStmtGetTagFields

func TaosStmtGetTagFields(stmt unsafe.Pointer) (code, num int, fields unsafe.Pointer)

TaosStmtGetTagFields DLL_EXPORT int taos_stmt_get_tag_fields(TAOS_STMT *stmt, int* fieldNum, TAOS_FIELD_E** fields);

func TaosStmtInit

func TaosStmtInit(taosConnect unsafe.Pointer) unsafe.Pointer

TaosStmtInit TAOS_STMT *taos_stmt_init(TAOS *taos);

func TaosStmtIsInsert

func TaosStmtIsInsert(stmt unsafe.Pointer) (is bool, errorCode int)

TaosStmtIsInsert int taos_stmt_is_insert(TAOS_STMT *stmt, int *insert);

func TaosStmtNumParams

func TaosStmtNumParams(stmt unsafe.Pointer) (count int, errorCode int)

TaosStmtNumParams int taos_stmt_num_params(TAOS_STMT *stmt, int *nums);

func TaosStmtPrepare

func TaosStmtPrepare(stmt unsafe.Pointer, sql string) int

TaosStmtPrepare int taos_stmt_prepare(TAOS_STMT *stmt, const char *sql, unsigned long length);

func TaosStmtSetSubTBName

func TaosStmtSetSubTBName(stmt unsafe.Pointer, name string) int

TaosStmtSetSubTBName int taos_stmt_set_sub_tbname(TAOS_STMT* stmt, const char* name);

func TaosStmtSetTBName

func TaosStmtSetTBName(stmt unsafe.Pointer, name string) int

TaosStmtSetTBName int taos_stmt_set_tbname(TAOS_STMT* stmt, const char* name);

func TaosStmtSetTBNameTags

func TaosStmtSetTBNameTags(stmt unsafe.Pointer, name string, tags []driver.Value) int

TaosStmtSetTBNameTags int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_MULTI_BIND* tags);

func TaosStmtSetTags

func TaosStmtSetTags(stmt unsafe.Pointer, tags []driver.Value) int

TaosStmtSetTags int taos_stmt_set_tags(TAOS_STMT *stmt, TAOS_MULTI_BIND *tags);

func TaosStmtUseResult

func TaosStmtUseResult(stmt unsafe.Pointer) unsafe.Pointer

TaosStmtUseResult TAOS_RES * taos_stmt_use_result(TAOS_STMT *stmt);

func TaosValidateSql

func TaosValidateSql(taosConnect unsafe.Pointer, sql string) int

TaosValidateSql int taos_validate_sql(TAOS *taos, const char *sql);

func TaosWriteRawBlock

func TaosWriteRawBlock(conn unsafe.Pointer, numOfRows int, pData unsafe.Pointer, tableName string) int

TaosWriteRawBlock DLL_EXPORT int taos_write_raw_block(TAOS *taos, int numOfRows, char *pData, const char* tbname);

Types

type Caller

type Caller interface {
	QueryCall(res unsafe.Pointer, code int)
	FetchCall(res unsafe.Pointer, numOfRows int)
}

type FormatTimeFunc

type FormatTimeFunc func(ts int64, precision int) driver.Value

type RawBlockColInfo

type RawBlockColInfo struct {
	ColType int8
	Bytes   int32
}

type RowsHeader

type RowsHeader struct {
	ColNames  []string
	ColTypes  []uint8
	ColLength []int64
}

func ReadColumn

func ReadColumn(result unsafe.Pointer, count int) (*RowsHeader, error)

func (*RowsHeader) ScanType

func (rh *RowsHeader) ScanType(i int) reflect.Type

func (*RowsHeader) TypeDatabaseName

func (rh *RowsHeader) TypeDatabaseName(i int) string

type StmtField

type StmtField struct {
	Name      string
	FieldType int8
	Precision uint8
	Scale     uint8
	Bytes     int32
}

typedef struct TAOS_FIELD_E { char name[65]; int8_t type; uint8_t precision; uint8_t scale; int32_t bytes; } TAOS_FIELD_E;

func StmtParseFields

func StmtParseFields(num int, fields unsafe.Pointer) []*StmtField

func (*StmtField) GetType

func (s *StmtField) GetType() (*taosTypes.ColumnType, error)

type TMQCommitCallbackResult

type TMQCommitCallbackResult struct {
	ErrCode  int32
	Consumer unsafe.Pointer
}

func GetTMQCommitCallbackResult

func GetTMQCommitCallbackResult(errCode int32, consumer unsafe.Pointer) *TMQCommitCallbackResult

func (*TMQCommitCallbackResult) GetError

func (t *TMQCommitCallbackResult) GetError() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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