protocol

package
v0.0.0-...-f04b8cf Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Max

func Max(x, y int) int

Max returns the larger of x or y.

Types

type CapabilityFlag

type CapabilityFlag uint32

CapabilityFlag is a bitmask that describes the server's supported capabilities.

func (CapabilityFlag) Has

func (r CapabilityFlag) Has(flag CapabilityFlag) bool

Has returns true if the flag is set.

func (CapabilityFlag) String

func (r CapabilityFlag) String() string

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 a byte slice

func (InitialHandshakePacket) String

func (r InitialHandshakePacket) String() string

Max returns the larger of x or y.

type PacketHeader

type PacketHeader struct {
	Length     uint32
	SequenceID uint8
}

PacketHeader represents packet header

Jump to

Keyboard shortcuts

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