Documentation ¶
Index ¶
Constants ¶
View Source
const ( ComQuit byte = iota + 1 ComQuery ComFieldList ComStmtPrepare ComStmtExecute ComStmtClose )
Variables ¶
This section is empty.
Functions ¶
func ScramblePassword ¶
Types ¶
type AuthorizationPacket ¶
type AuthorizationPacket struct { PacketPart1 []byte Username []byte Password []byte CapData []byte CapData2 []byte PacketPart2 []byte // contains filtered or unexported fields }
func GetAuthPacket ¶
func GetAuthPacket(conn net.Conn) *AuthorizationPacket
func (AuthorizationPacket) Encode ¶
func (r AuthorizationPacket) Encode() ([]byte, error)
type CapabilityFlag ¶
type CapabilityFlag uint32
func (CapabilityFlag) Has ¶
func (r CapabilityFlag) Has(flag CapabilityFlag) bool
func (CapabilityFlag) String ¶
func (r CapabilityFlag) String() string
type Connection ¶
type Connection struct { JmsService *service.JMService FakeServer *FakeServer Finished *chan struct{} // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(fakeSrv *FakeServer) *Connection
type CurrSession ¶
type FakeHandshakePacket ¶
type FakeHandshakePacket struct { Protocol byte Version []byte ThreadId []byte Salt []byte ServerCapabilities []byte ServerLanguage byte ServerStatus []byte ExtendedServerCapabilities []byte AuthenticationPluginLength byte Unused []byte Salt2 []byte AuthenticationPlugin []byte // contains filtered or unexported fields }
func (*FakeHandshakePacket) Encode ¶
func (r *FakeHandshakePacket) Encode() ([]byte, error)
func (*FakeHandshakePacket) IncrementConnectID ¶
func (f *FakeHandshakePacket) IncrementConnectID(curID []byte)
func (*FakeHandshakePacket) NewHandshakePacket ¶
func (r *FakeHandshakePacket) NewHandshakePacket(connID []byte) error
type FakeServer ¶
type FakeServer struct { Conn net.Conn JmsService *service.JMService Host string Port int Username string Password string CurrSession *CurrSession Token *service.TokenAuthInfoResponse }
func (*FakeServer) GetCommandRecorder ¶
func (fs *FakeServer) GetCommandRecorder() *proxy.CommandRecorder
func (*FakeServer) GetRecorders ¶
func (fs *FakeServer) GetRecorders() (*proxy.ReplyRecorder, *proxy.CommandRecorder)
func (*FakeServer) GetReplayRecorder ¶
func (fs *FakeServer) GetReplayRecorder() *proxy.ReplyRecorder
func (*FakeServer) Start ¶
func (fs *FakeServer) Start()
type InitialHandshakePacket ¶
type InitialHandshakePacket struct { ProtocolVersion uint8 ServerVersion []byte ConnectionId uint32 AuthPluginData []byte Filler byte CapabilitiesFlags CapabilityFlag CharacterSet uint8 StatusFlags uint16 AuthPluginDataLen uint8 AuthPluginName []byte // contains filtered or unexported fields }
InitialHandshakePacket represents initial handshake packet sent by MySQL Server
func (*InitialHandshakePacket) Decode ¶
func (r *InitialHandshakePacket) Decode(conn net.Conn) error
Decode decodes the first packet received from the MySQl Server It's a handshake packet
func (InitialHandshakePacket) Encode ¶
func (r InitialHandshakePacket) Encode() ([]byte, error)
Encode encodes the InitialHandshakePacket to bytes
func (InitialHandshakePacket) String ¶
func (r InitialHandshakePacket) String() string
type PacketHeader ¶
PacketHeader represents packet header
Click to show internal directories.
Click to hide internal directories.