Documentation ¶
Index ¶
- Constants
- func CloseWs(session *melody.Session)
- type BaseResponse
- func (b *BaseResponse) IsBinary() bool
- func (b *BaseResponse) IsNull() bool
- func (b *BaseResponse) SetAction(action string)
- func (b *BaseResponse) SetBinary(binary bool)
- func (b *BaseResponse) SetCode(code int)
- func (b *BaseResponse) SetMessage(message string)
- func (b *BaseResponse) SetNull(null bool)
- func (b *BaseResponse) SetReqID(reqID uint64)
- func (b *BaseResponse) SetTiming(timing int64)
- type BinaryResponse
- type ConnRequest
- type FetchBlockRequest
- type FetchRequest
- type FetchResponse
- type FreeResultRequest
- type GetCurrentDBResponse
- type GetServerInfoResponse
- type NumFieldsRequest
- type NumFieldsResponse
- type QueryRequest
- type QueryResponse
- type QueryResult
- type QueryResultHolder
- type Request
- type RequestID
- type Response
- type SchemalessWriteRequest
- type SchemalessWriteResponse
- type StmtAddBatchRequest
- type StmtAddBatchResponse
- type StmtBindRequest
- type StmtBindResponse
- type StmtCloseRequest
- type StmtCloseResponse
- type StmtExecRequest
- type StmtExecResponse
- type StmtGetColFieldsRequest
- type StmtGetColFieldsResponse
- type StmtGetParamRequest
- type StmtGetParamResponse
- type StmtGetTagFieldsRequest
- type StmtGetTagFieldsResponse
- type StmtHolder
- type StmtInitResponse
- type StmtItem
- type StmtNumParamsRequest
- type StmtNumParamsResponse
- type StmtPrepareRequest
- type StmtPrepareResponse
- type StmtSetTableNameRequest
- type StmtSetTableNameResponse
- type StmtSetTagsRequest
- type StmtSetTagsResponse
- type StmtUseResultRequest
- type StmtUseResultResponse
- type VersionResponse
- type WSStmtErrorResp
Constants ¶
View Source
const ( Connect = "conn" // websocket WSQuery = "query" WSFetch = "fetch" WSFetchBlock = "fetch_block" WSFreeResult = "free_result" WSWriteRaw = "write_raw" WSWriteRawBlock = "write_raw_block" WSWriteRawBlockWithFields = "write_raw_block_with_fields" WSGetCurrentDB = "get_current_db" WSGetServerInfo = "get_server_info" WSNumFields = "num_fields" // schemaless SchemalessWrite = "insert" // stmt STMTInit = "init" STMTPrepare = "prepare" STMTSetTableName = "set_table_name" STMTSetTags = "set_tags" STMTBind = "bind" STMTAddBatch = "add_batch" STMTExec = "exec" STMTClose = "close" STMTGetTagFields = "get_tag_fields" STMTGetColFields = "get_col_fields" STMTUseResult = "use_result" STMTNumParams = "stmt_num_params" STMTGetParam = "stmt_get_param" )
View Source
const ( SetTagsMessage messageType BindMessage TMQRawMessage RawBlockMessage RawBlockMessageWithFields BinaryQueryMessage FetchRawBlockMessage )
View Source
const (
BinaryProtocolVersion1 uint16 = 1
)
View Source
const TaosKey = "taos"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseResponse ¶
type BaseResponse struct { Code int `json:"code"` Message string `json:"message"` Action string `json:"action"` ReqID uint64 `json:"req_id"` Timing int64 `json:"timing"` // contains filtered or unexported fields }
func (*BaseResponse) IsBinary ¶
func (b *BaseResponse) IsBinary() bool
func (*BaseResponse) IsNull ¶
func (b *BaseResponse) IsNull() bool
func (*BaseResponse) SetAction ¶
func (b *BaseResponse) SetAction(action string)
func (*BaseResponse) SetBinary ¶
func (b *BaseResponse) SetBinary(binary bool)
func (*BaseResponse) SetCode ¶
func (b *BaseResponse) SetCode(code int)
func (*BaseResponse) SetMessage ¶
func (b *BaseResponse) SetMessage(message string)
func (*BaseResponse) SetNull ¶
func (b *BaseResponse) SetNull(null bool)
func (*BaseResponse) SetReqID ¶
func (b *BaseResponse) SetReqID(reqID uint64)
func (*BaseResponse) SetTiming ¶
func (b *BaseResponse) SetTiming(timing int64)
type BinaryResponse ¶
type BinaryResponse struct { BaseResponse Data []byte }
type ConnRequest ¶
type FetchBlockRequest ¶
type FetchRequest ¶
type FetchResponse ¶
type FetchResponse struct { BaseResponse ID uint64 `json:"id"` Completed bool `json:"completed"` Lengths []int `json:"lengths"` Rows int `json:"rows"` }
type FreeResultRequest ¶
type GetCurrentDBResponse ¶
type GetCurrentDBResponse struct { BaseResponse DB string `json:"db"` }
type GetServerInfoResponse ¶
type GetServerInfoResponse struct { BaseResponse Info string `json:"info"` }
type NumFieldsRequest ¶
type NumFieldsResponse ¶
type NumFieldsResponse struct { BaseResponse NumFields int `json:"num_fields"` }
type QueryRequest ¶
type QueryResponse ¶
type QueryResponse struct { BaseResponse ID uint64 `json:"id"` IsUpdate bool `json:"is_update"` AffectedRows int `json:"affected_rows"` FieldsCount int `json:"fields_count"` FieldsNames []string `json:"fields_names"` FieldsTypes jsontype.JsonUint8 `json:"fields_types"` FieldsLengths []int64 `json:"fields_lengths"` Precision int `json:"precision"` }
type QueryResult ¶
type QueryResultHolder ¶
func NewQueryResultHolder ¶
func NewQueryResultHolder() *QueryResultHolder
func (*QueryResultHolder) Add ¶
func (h *QueryResultHolder) Add(result *QueryResult) uint64
func (*QueryResultHolder) FreeAll ¶
func (h *QueryResultHolder) FreeAll()
func (*QueryResultHolder) FreeResultByID ¶
func (h *QueryResultHolder) FreeResultByID(index uint64)
func (*QueryResultHolder) Get ¶
func (h *QueryResultHolder) Get(index uint64) *QueryResult
type Request ¶
type Request struct { ReqID uint64 `json:"req_id"` Action string `json:"action"` Args json.RawMessage `json:"args"` }
type SchemalessWriteRequest ¶
type SchemalessWriteResponse ¶
type SchemalessWriteResponse struct { BaseResponse AffectedRows int `json:"affected_rows"` TotalRows int32 `json:"total_rows"` }
type StmtAddBatchRequest ¶
type StmtAddBatchResponse ¶
type StmtAddBatchResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` }
type StmtBindRequest ¶
type StmtBindRequest struct { ReqID uint64 `json:"req_id"` StmtID uint64 `json:"stmt_id"` Columns json.RawMessage `json:"columns"` }
type StmtBindResponse ¶
type StmtBindResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` }
type StmtCloseRequest ¶
type StmtCloseResponse ¶
type StmtCloseResponse struct { BaseResponse StmtID uint64 `json:"stmt_id,omitempty"` }
type StmtExecRequest ¶
type StmtExecResponse ¶
type StmtExecResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` Affected int `json:"affected"` }
type StmtGetColFieldsRequest ¶
type StmtGetColFieldsResponse ¶
type StmtGetColFieldsResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` Fields []*stmtCommon.StmtField `json:"fields"` }
type StmtGetParamRequest ¶
type StmtGetParamResponse ¶
type StmtGetParamResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` Index int `json:"index"` DataType int `json:"data_type"` Length int `json:"length"` }
type StmtGetTagFieldsRequest ¶
type StmtGetTagFieldsResponse ¶
type StmtGetTagFieldsResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` Fields []*stmtCommon.StmtField `json:"fields,omitempty"` }
type StmtHolder ¶
func NewStmtHolder ¶
func NewStmtHolder() *StmtHolder
func (*StmtHolder) Add ¶
func (h *StmtHolder) Add(item *StmtItem) uint64
func (*StmtHolder) FreeAll ¶
func (h *StmtHolder) FreeAll()
func (*StmtHolder) FreeStmtByID ¶
func (h *StmtHolder) FreeStmtByID(index uint64)
func (*StmtHolder) Get ¶
func (h *StmtHolder) Get(index uint64) *StmtItem
type StmtInitResponse ¶
type StmtInitResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` }
type StmtNumParamsRequest ¶
type StmtNumParamsResponse ¶
type StmtNumParamsResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` NumParams int `json:"num_params"` }
type StmtPrepareRequest ¶
type StmtPrepareResponse ¶
type StmtPrepareResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` IsInsert bool `json:"is_insert"` }
type StmtSetTableNameRequest ¶
type StmtSetTableNameResponse ¶
type StmtSetTableNameResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` }
type StmtSetTagsRequest ¶
type StmtSetTagsRequest struct { ReqID uint64 `json:"req_id"` StmtID uint64 `json:"stmt_id"` Tags json.RawMessage `json:"tags"` }
type StmtSetTagsResponse ¶
type StmtSetTagsResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` }
type StmtUseResultRequest ¶
type StmtUseResultResponse ¶
type StmtUseResultResponse struct { BaseResponse StmtID uint64 `json:"stmt_id"` ResultID uint64 `json:"result_id"` FieldsCount int `json:"fields_count"` FieldsNames []string `json:"fields_names"` FieldsTypes jsontype.JsonUint8 `json:"fields_types"` FieldsLengths []int64 `json:"fields_lengths"` Precision int `json:"precision"` }
type VersionResponse ¶
type VersionResponse struct { BaseResponse Version string `json:"version"` }
type WSStmtErrorResp ¶
type WSStmtErrorResp struct { BaseResponse StmtID uint64 `json:"stmt_id"` }
Click to show internal directories.
Click to hide internal directories.