Versions in this module Expand all Collapse all v1 v1.0.5 Feb 18, 2022 Changes in this version + const AuthMoreDataPacketHeader + const AuthSwitchRequestPacketHeader + const EOFPacketHeader + const ErrPacketHeader + const LocalInfileRequest + const OKPacketHeader + const SESSION_TRACK_GTIDS + const SESSION_TRACK_SCHEMA + const SESSION_TRACK_STATE_CHANGE + const SESSION_TRACK_SYSTEM_VARIABLES + var ErrPacketData = errors.New("packet: data error") + var FixedLengthInteger fixedLengthInteger + var LengthEncodedInteger lengthEncodedInteger + var LengthEncodedString lengthEncodedString + var NulTerminatedString nulTerminatedString + func IsAuthMoreData(data []byte) bool + func IsAuthSwitchRequest(data []byte) bool + func IsEOF(data []byte) bool + func IsErr(data []byte) bool + func IsLocalInfileRequest(data []byte) bool + func IsOK(data []byte) bool + func IsPing(data []byte) bool + func IsQuery(data []byte) bool + func IsQuit(data []byte) bool + func ParseAuthMoreData(data []byte) ([]byte, error) + func ParseColumnCount(data []byte) (uint64, error) + type Attribute struct + Key string + Val string + type AuthSwitchRequest struct + AuthData []byte + AuthPlugin core.AuthenticationPlugin + PayloadHeader uint8 + func ParseAuthSwitchRequest(data []byte) (*AuthSwitchRequest, error) + type BinaryResultSetRow struct + NullBitMap []byte + PktHeader byte + Row Row + func (p *BinaryResultSetRow) NullBitMapGet(index int) bool + type Column interface + GetCharSet func() *core.Collation + GetDatabase func() string + GetDecimals func() byte + GetFlags func() core.ColumnDefinitionFlag + GetLength func() uint32 + GetName func() string + GetTable func() string + GetType func() core.TableColumnType + String func() string + func ParseColumnDefinition(bs []byte) (Column, error) + type ColumnDefinition struct + Catalog string + CharacterSet *core.Collation + ColumnLength uint32 + ColumnType core.TableColumnType + Decimals uint8 + Flags core.ColumnDefinitionFlag + Name string + NextLength uint64 + OrgName string + OrgTable string + Schema string + Table string + func (p *ColumnDefinition) Dump(capabilities core.CapabilityFlag) ([]byte, error) + func (p *ColumnDefinition) GetCharSet() *core.Collation + func (p *ColumnDefinition) GetDatabase() string + func (p *ColumnDefinition) GetDecimals() byte + func (p *ColumnDefinition) GetFlags() core.ColumnDefinitionFlag + func (p *ColumnDefinition) GetLength() uint32 + func (p *ColumnDefinition) GetName() string + func (p *ColumnDefinition) GetTable() string + func (p *ColumnDefinition) GetType() core.TableColumnType + func (p *ColumnDefinition) String() string + type ColumnValue interface + DumpBinary func() ([]byte, error) + DumpText func() ([]byte, error) + IsNull func() bool + String func() string + Value func() Value + func NewColumnValue(isNull bool, val interface{}, mysqlType core.TableColumnType) ColumnValue + type EOF struct + EOFHeader uint8 + StatusFlags core.StatusFlag + WarningCount uint16 + func NewEOF(warningCount int, statusFlag core.StatusFlag) *EOF + func ParseEOF(bs []byte, capabilities core.CapabilityFlag) (*EOF, error) + func (eof *EOF) Dump(capabilities core.CapabilityFlag) ([]byte, error) + type ERR struct + ERRHeader uint8 + ErrorCode core.Code + ErrorMessage string + SqlState string + SqlStateMarker byte + func NewERR(code core.Code, sqlState, message string) *ERR + func ParseERR(bs []byte, capabilities core.CapabilityFlag) (*ERR, error) + func (e *ERR) Dump(capabilities core.CapabilityFlag) ([]byte, error) + func (e *ERR) Error() string + type Handshake struct + AuthPlugin core.AuthenticationPlugin + AuthPluginDataLen uint8 + CapabilityFlags core.CapabilityFlag + CharacterSet *core.Collation + ConnectionId uint32 + ExtendedCapabilityFlags core.CapabilityFlag + ProtocolVersion uint8 + Salt1 []byte + Salt2 []byte + ServerVersion string + StatusFlags core.StatusFlag + func ParseHandshake(bs []byte) (*Handshake, error) + func (p *Handshake) Dump(capabilities core.CapabilityFlag) ([]byte, error) + func (p *Handshake) GetAuthData() []byte + func (p *Handshake) GetCapabilities() core.CapabilityFlag + func (p *Handshake) SetCapabilities(capabilities core.CapabilityFlag) + type HandshakeResponse struct + AttributeLen uint64 + Attributes []Attribute + AuthPlugin core.AuthenticationPlugin + AuthRes []byte + CharacterSet *core.Collation + ClientCapabilityFlags core.CapabilityFlag + Database []byte + MaxPacketSize uint32 + Username []byte + func ParseHandshakeResponse(bs []byte) (*HandshakeResponse, error) + func (p *HandshakeResponse) AddAttribute(key string, val string) + func (p *HandshakeResponse) Dump(capabilities core.CapabilityFlag) ([]byte, error) + func (p *HandshakeResponse) GetUsername() string + type Header struct + Length uint32 + Seq uint8 + func (h *Header) Dump(core.CapabilityFlag) ([]byte, error) + func (h *Header) Parse(buf *bytes.Buffer) error + func (h *Header) SetSequence(seq int) + type OK struct + AffectedRows uint64 + Info []byte + LastInsertId uint64 + OKHeader uint8 + SessionStateChanges []byte + StatusFlags core.StatusFlag + WarningCount uint16 + func ParseOk(bs []byte, capabilities core.CapabilityFlag) (*OK, error) + func (p *OK) Dump(capabilities core.CapabilityFlag) ([]byte, error) + type Packet interface + Dump func(core.CapabilityFlag) ([]byte, error) + SetSequence func(int) + func NewColumnCount(count int) (Packet, error) + type Row []ColumnValue + func ParseBinaryResultSetRow(data []byte, columns []Column, loc *time.Location) (Row, error) + func ParseTextResultSetRow(data []byte, columns []Column, loc *time.Location) (Row, error) + func (r Row) String() string + type SSLRequest struct + CharacterSet *core.Collation + ClientCapabilityFlags core.CapabilityFlag + MaxPacketSize uint32 + func ParseSSLRequest(data []byte) (*SSLRequest, error) + func (p *SSLRequest) Dump(capabilities core.CapabilityFlag) ([]byte, error) + type Simple struct + Payload []byte + func New(cmd core.Command, data []byte) *Simple + func NewAuthSwitchResponse(authRes []byte) *Simple + func NewSimple(payload []byte) *Simple + func (p *Simple) Dump(capabilities core.CapabilityFlag) ([]byte, error) + type StmtExecute struct + ComStmtExecute uint8 + Flags uint8 + IterationCount uint32 + NewParamsBoundFlag uint8 + NullBitMap []byte + ParamType []byte + ParamValue []byte + StmtId uint32 + func NewStmtExecute() *StmtExecute + func (p *StmtExecute) CreateNullBitMap(paramCount int) + func (p *StmtExecute) Dump(capabilities core.CapabilityFlag) ([]byte, error) + func (p *StmtExecute) NullBitMapSet(paramCount, index int) + type StmtPrepareOKFirst struct + ColumnCount uint16 + ParamCount uint16 + Status uint8 + StmtId uint32 + WarningCount uint16 + func ParseStmtPrepareOKFirst(data []byte) (*StmtPrepareOKFirst, error) + type TextResultSetRow struct + Row Row + func NewTextResultSetRow(row Row) *TextResultSetRow + func (p *TextResultSetRow) Dump(capabilities core.CapabilityFlag) ([]byte, error) + type Value interface v1.0.4 Jan 28, 2022 v1.0.3 Jan 27, 2022 v1.0.2 Jan 27, 2022 v1.0.1 Jan 26, 2022 v1.0.0 Jan 26, 2022