packet

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufPool

type BufPool struct {
	// contains filtered or unexported fields
}

func NewBufPool

func NewBufPool() *BufPool

func (*BufPool) Get

func (b *BufPool) Get() *bytes.Buffer

func (*BufPool) Return

func (b *BufPool) Return(buf *bytes.Buffer)

type Conn

type Conn struct {
	net.Conn

	Sequence uint8

	Compression uint8

	CompressedSequence uint8
	// contains filtered or unexported fields
}

Conn is the base class to handle MySQL protocol.

func NewConn

func NewConn(conn net.Conn) *Conn

func NewTLSConn

func NewTLSConn(conn net.Conn) *Conn

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) ReadPacket

func (c *Conn) ReadPacket() ([]byte, error)

func (*Conn) ReadPacketReuseMem

func (c *Conn) ReadPacketReuseMem(dst []byte) ([]byte, error)

func (*Conn) ReadPacketTo

func (c *Conn) ReadPacketTo(w io.Writer, r io.Reader) error

func (*Conn) ResetSequence

func (c *Conn) ResetSequence()

func (*Conn) WriteClearAuthPacket

func (c *Conn) WriteClearAuthPacket(password string) error

WriteClearAuthPacket: Client clear text authentication packet http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse

func (*Conn) WriteEncryptedPassword

func (c *Conn) WriteEncryptedPassword(password string, seed []byte, pub *rsa.PublicKey) error

func (*Conn) WritePacket

func (c *Conn) WritePacket(data []byte) error

WritePacket: data already has 4 bytes header will modify data inplace

func (*Conn) WritePublicKeyAuthPacket

func (c *Conn) WritePublicKeyAuthPacket(password string, cipher []byte) error

WritePublicKeyAuthPacket: Caching sha2 authentication. Public key request and send encrypted password http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse

Jump to

Keyboard shortcuts

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