ws

package
v3.0.0-...-2419b40 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Connect = "conn"
	// websocket
	WSQuery         = "query"
	WSFetch         = "fetch"
	WSFetchBlock    = "fetch_block"
	WSFreeResult    = "free_result"
	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"

	// stmt2
	STMT2Init    = "stmt2_init"
	STMT2Prepare = "stmt2_prepare"
	STMT2Exec    = "stmt2_exec"
	STMT2Result  = "stmt2_result"
	STMT2Close   = "stmt2_close"

	// options
	OptionsConnection = "options_connection"

	// check_server_status
	CheckServerStatus = "check_server_status"
)
View Source
const (
	SetTagsMessage            = 1
	BindMessage               = 2
	TMQRawMessage             = 3
	RawBlockMessage           = 4
	RawBlockMessageWithFields = 5
	BinaryQueryMessage        = 6
	FetchRawBlockMessage      = 7
	Stmt2BindMessage          = 9
	ValidateSQL               = 10
)
View Source
const (
	BinaryProtocolVersion1    uint16 = 1
	Stmt2BindProtocolVersion1 uint16 = 1
)
View Source
const TaosKey = "taos"

Variables

This section is empty.

Functions

func CloseWs

func CloseWs(session *melody.Session)

Types

type QueryResult

type QueryResult struct {
	TaosResult  unsafe.Pointer
	FieldsCount int
	Header      *wrapper.RowsHeader
	Lengths     []int
	Size        int
	Block       unsafe.Pointer

	sync.Mutex
	// contains filtered or unexported fields
}

type QueryResultHolder

type QueryResultHolder struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewQueryResultHolder

func NewQueryResultHolder() *QueryResultHolder

func (*QueryResultHolder) Add

func (h *QueryResultHolder) Add(result *QueryResult) uint64

func (*QueryResultHolder) FreeAll

func (h *QueryResultHolder) FreeAll(logger *logrus.Entry)

func (*QueryResultHolder) FreeResultByID

func (h *QueryResultHolder) FreeResultByID(index uint64, logger *logrus.Entry)

func (*QueryResultHolder) Get

func (h *QueryResultHolder) Get(index uint64) *QueryResult

type Request

type Request struct {
	Action string          `json:"action"`
	Args   json.RawMessage `json:"args"`
}

type StmtHolder

type StmtHolder struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStmtHolder

func NewStmtHolder() *StmtHolder

func (*StmtHolder) Add

func (h *StmtHolder) Add(item *StmtItem) uint64

func (*StmtHolder) FreeAll

func (h *StmtHolder) FreeAll(logger *logrus.Entry)

func (*StmtHolder) FreeStmtByID

func (h *StmtHolder) FreeStmtByID(index uint64, isStmt2 bool, logger *logrus.Entry) error

func (*StmtHolder) Get

func (h *StmtHolder) Get(index uint64) *StmtItem

func (*StmtHolder) GetStmt2

func (h *StmtHolder) GetStmt2(index uint64) *StmtItem

type StmtItem

type StmtItem struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type VersionResponse

type VersionResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Action  string `json:"action"`
	ReqID   uint64 `json:"req_id"`
	Timing  int64  `json:"timing"`
	Version string `json:"version"`
}

Jump to

Keyboard shortcuts

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