Documentation
¶
Index ¶
- Constants
- Variables
- type AddBatchReq
- type AddBatchResp
- type BindReq
- type BindResp
- type CloseReq
- type Config
- func (c *Config) SetAutoReconnect(reconnect bool)
- func (c *Config) SetCloseHandler(f func())
- func (c *Config) SetConnectDB(db string) error
- func (c *Config) SetConnectPass(pass string) error
- func (c *Config) SetConnectUser(user string) error
- func (c *Config) SetEnableCompression(enableCompression bool)
- func (c *Config) SetErrorHandler(f func(connector *Connector, err error))
- func (c *Config) SetMessageTimeout(timeout time.Duration) error
- func (c *Config) SetReconnectIntervalMs(reconnectIntervalMs int)
- func (c *Config) SetReconnectRetryCount(reconnectRetryCount int)
- func (c *Config) SetWriteWait(writeWait time.Duration) error
- type ConnectReq
- type ConnectResp
- type Connector
- type ExecReq
- type ExecResp
- type IndexedChan
- type InitReq
- type InitResp
- type PrepareReq
- type PrepareResp
- type Rows
- type SetTableNameReq
- type SetTableNameResp
- type SetTagsReq
- type SetTagsResp
- type Stmt
- func (s *Stmt) AddBatch() error
- func (s *Stmt) BindParam(params []*param.Param, bindType *param.ColumnType) error
- func (s *Stmt) Close() error
- func (s *Stmt) Exec() error
- func (s *Stmt) GetAffectedRows() int
- func (s *Stmt) Prepare(sql string) error
- func (s *Stmt) SetTableName(name string) error
- func (s *Stmt) SetTags(tags *param.Param, bindType *param.ColumnType) error
- func (s *Stmt) UseResult() (*Rows, error)
- type UseResultReq
- type UseResultResp
- type WSFetchBlockReq
- type WSFetchReq
- type WSFetchResp
- type WSFreeResultRequest
Constants ¶
View Source
const ( SetTagsMessage = 1 BindMessage = 2 )
View Source
const ( STMTConnect = "conn" STMTInit = "init" STMTPrepare = "prepare" STMTSetTableName = "set_table_name" STMTAddBatch = "add_batch" STMTExec = "exec" STMTClose = "close" STMTUseResult = "use_result" WSFetch = "fetch" WSFetchBlock = "fetch_block" WSFreeResult = "free_result" )
Variables ¶
View Source
var (
ConnectTimeoutErr = errors.New("stmt connect timeout")
)
Functions ¶
This section is empty.
Types ¶
type AddBatchReq ¶
type AddBatchResp ¶
type BindReq ¶
type BindReq struct {
ReqID uint64 `json:"req_id"`
StmtID uint64 `json:"stmt_id"`
Columns json.RawMessage `json:"columns"`
}
type Config ¶
type Config struct {
Url string
ChanLength uint
MessageTimeout time.Duration
WriteWait time.Duration
ErrorHandler func(connector *Connector, err error)
CloseHandler func()
User string
Password string
DB string
EnableCompression bool
AutoReconnect bool
ReconnectIntervalMs int
ReconnectRetryCount int
}
func (*Config) SetAutoReconnect ¶
func (*Config) SetCloseHandler ¶
func (c *Config) SetCloseHandler(f func())
func (*Config) SetConnectDB ¶
func (*Config) SetConnectPass ¶
func (*Config) SetConnectUser ¶
func (*Config) SetEnableCompression ¶
func (*Config) SetErrorHandler ¶
func (*Config) SetReconnectIntervalMs ¶
func (*Config) SetReconnectRetryCount ¶
type ConnectReq ¶
type ConnectResp ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func NewConnector ¶
type IndexedChan ¶
type IndexedChan struct {
// contains filtered or unexported fields
}
type PrepareReq ¶
type PrepareResp ¶
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
func (*Rows) ColumnTypeDatabaseTypeName ¶
type SetTableNameReq ¶
type SetTableNameResp ¶
type SetTagsReq ¶
type SetTagsReq struct {
ReqID uint64 `json:"req_id"`
StmtID uint64 `json:"stmt_id"`
Tags json.RawMessage `json:"tags"`
}
type SetTagsResp ¶
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
func (*Stmt) GetAffectedRows ¶
func (*Stmt) SetTableName ¶
type UseResultReq ¶
type UseResultResp ¶
type UseResultResp struct {
Code int `json:"code"`
Message string `json:"message"`
Action string `json:"action"`
ReqID uint64 `json:"req_id"`
Timing int64 `json:"timing"`
StmtID uint64 `json:"stmt_id"`
ResultID uint64 `json:"result_id"`
FieldsCount int `json:"fields_count"`
FieldsNames []string `json:"fields_names"`
FieldsTypes []uint8 `json:"fields_types"`
FieldsLengths []int64 `json:"fields_lengths"`
Precision int `json:"precision"`
}
type WSFetchBlockReq ¶
type WSFetchReq ¶
type WSFetchResp ¶
type WSFreeResultRequest ¶
Click to show internal directories.
Click to hide internal directories.