connection

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthSwitchResponse

func NewAuthSwitchResponse(authRes []byte) *generic.Simple

func ParseAuthMoreData

func ParseAuthMoreData(data []byte) ([]byte, error)

Types

type Attribute

type Attribute struct {
	Key string
	Val string
}

type AuthSwitchRequest

type AuthSwitchRequest struct {
	generic.Header

	PayloadHeader uint8
	AuthPlugin    generic.AuthenticationPlugin
	AuthData      []byte
}

func ParseAuthSwitchRequest

func ParseAuthSwitchRequest(data []byte) (*AuthSwitchRequest, error)

type Handshake

type Handshake struct {
	generic.Header

	ProtocolVersion         uint8
	ServerVersion           string
	ConnectionId            uint32
	Salt1                   []byte
	CapabilityFlags         generic.CapabilityFlag
	CharacterSet            *generic.Collation
	StatusFlags             generic.StatusFlag
	ExtendedCapabilityFlags generic.CapabilityFlag
	AuthPluginDataLen       uint8
	Salt2                   []byte
	AuthPlugin              generic.AuthenticationPlugin
}

Handshake https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::Handshake

func ParseHandshake

func ParseHandshake(bs []byte) (*Handshake, error)

func (*Handshake) GetAuthData

func (p *Handshake) GetAuthData() []byte

func (*Handshake) GetCapabilities

func (p *Handshake) GetCapabilities() generic.CapabilityFlag

type HandshakeResponse

type HandshakeResponse struct {
	generic.Header

	ClientCapabilityFlags generic.CapabilityFlag
	MaxPacketSize         uint32
	CharacterSet          *generic.Collation
	Username              []byte // interpreted by CharacterSet
	AuthRes               []byte
	Database              []byte // interpreted by CharacterSet
	AuthPlugin            generic.AuthenticationPlugin

	AttributeLen uint64
	Attributes   []Attribute
}

HandshakeResponse https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse

func ParseHandshakeResponse

func ParseHandshakeResponse(bs []byte) (*HandshakeResponse, error)

func (*HandshakeResponse) AddAttribute

func (p *HandshakeResponse) AddAttribute(key string, val string)

func (*HandshakeResponse) Dump

func (p *HandshakeResponse) Dump() []byte

Jump to

Keyboard shortcuts

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