Documentation ¶
Index ¶
- Variables
- type Codec
- type ExtraInfo
- type ExtraInfoV0
- func (i *ExtraInfoV0) GetConnectionID() (uint32, bool)
- func (i *ExtraInfoV0) GetInternalConn() (bool, bool)
- func (i *ExtraInfoV0) GetLabel() (RequestLabel, bool)
- func (i *ExtraInfoV0) GetSalt() ([]byte, bool)
- func (i *ExtraInfoV0) Marshal(v Version) ([]byte, error)
- func (i *ExtraInfoV0) Unmarshal(data []byte) error
- type InfoFetcher
- type RequestLabel
- func (*RequestLabel) Descriptor() ([]byte, []int)
- func (m *RequestLabel) GetLabels() map[string]string
- func (m *RequestLabel) Marshal() (dAtA []byte, err error)
- func (m *RequestLabel) MarshalTo(dAtA []byte) (int, error)
- func (m *RequestLabel) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*RequestLabel) ProtoMessage()
- func (m *RequestLabel) Reset()
- func (m *RequestLabel) Size() (n int)
- func (m *RequestLabel) String() string
- func (m *RequestLabel) Unmarshal(dAtA []byte) error
- func (m *RequestLabel) XXX_DiscardUnknown()
- func (m *RequestLabel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RequestLabel) XXX_Merge(src proto.Message)
- func (m *RequestLabel) XXX_Size() int
- func (m *RequestLabel) XXX_Unmarshal(b []byte) error
- type Version
- type VersionedExtraInfo
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthProxy = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowProxy = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupProxy = fmt.Errorf("proto: unexpected end of group") )
var (
Endian = binary.LittleEndian
)
var ( // Version0 is the first version, whose major and minor are both -1. Version0 = Version{Major: 1, Minor: 0, Patch: 0} )
Functions ¶
This section is empty.
Types ¶
type ExtraInfo ¶ added in v1.0.0
type ExtraInfo interface { Codec InfoFetcher }
ExtraInfo is the extra information between proxy and cn.
type ExtraInfoV0 ¶ added in v1.1.0
type ExtraInfoV0 struct { // Salt is the bytes in MySQL protocol which is 20 length. Salt []byte // InternalConn indicates whether the connection is from internal // network or external network. false means that it is external, otherwise, // it is internal. InternalConn bool // ConnectionID sent from proxy, cn side should update its connection ID. ConnectionID uint32 // Label is the requested label from client. Label RequestLabel }
ExtraInfoV0 is the information that proxy send to CN when build connection in handshake phase.
func (*ExtraInfoV0) GetConnectionID ¶ added in v1.1.0
func (i *ExtraInfoV0) GetConnectionID() (uint32, bool)
GetConnectionID implements the InfoFetcher interface.
func (*ExtraInfoV0) GetInternalConn ¶ added in v1.1.0
func (i *ExtraInfoV0) GetInternalConn() (bool, bool)
GetInternalConn implements the InfoFetcher interface.
func (*ExtraInfoV0) GetLabel ¶ added in v1.1.0
func (i *ExtraInfoV0) GetLabel() (RequestLabel, bool)
GetLabel implements the InfoFetcher interface.
func (*ExtraInfoV0) GetSalt ¶ added in v1.1.0
func (i *ExtraInfoV0) GetSalt() ([]byte, bool)
GetSalt implements the InfoFetcher interface.
func (*ExtraInfoV0) Marshal ¶ added in v1.1.0
func (i *ExtraInfoV0) Marshal(v Version) ([]byte, error)
Marshal implements the Codec interface.
func (*ExtraInfoV0) Unmarshal ¶ added in v1.1.0
func (i *ExtraInfoV0) Unmarshal(data []byte) error
Unmarshal implements the Codec interface.
type InfoFetcher ¶ added in v1.1.0
type InfoFetcher interface { // GetSalt returns the salt value. GetSalt() ([]byte, bool) // GetInternalConn returns the internal conn value. GetInternalConn() (bool, bool) // GetConnectionID returns the connection ID value. GetConnectionID() (uint32, bool) // GetLabel returns the label value. GetLabel() (RequestLabel, bool) }
InfoFetcher is the interface used to fetch information. The last return value of all methods in the interface must be a boolean value to indicates whether the method is supported by the version.
type RequestLabel ¶
type RequestLabel struct { Labels map[string]string `` /* 153-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RequestLabel) Descriptor ¶
func (*RequestLabel) Descriptor() ([]byte, []int)
func (*RequestLabel) GetLabels ¶
func (m *RequestLabel) GetLabels() map[string]string
func (*RequestLabel) Marshal ¶
func (m *RequestLabel) Marshal() (dAtA []byte, err error)
func (*RequestLabel) MarshalToSizedBuffer ¶
func (m *RequestLabel) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*RequestLabel) ProtoMessage ¶
func (*RequestLabel) ProtoMessage()
func (*RequestLabel) Reset ¶
func (m *RequestLabel) Reset()
func (*RequestLabel) Size ¶
func (m *RequestLabel) Size() (n int)
func (*RequestLabel) String ¶
func (m *RequestLabel) String() string
func (*RequestLabel) Unmarshal ¶
func (m *RequestLabel) Unmarshal(dAtA []byte) error
func (*RequestLabel) XXX_DiscardUnknown ¶
func (m *RequestLabel) XXX_DiscardUnknown()
func (*RequestLabel) XXX_Marshal ¶
func (m *RequestLabel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RequestLabel) XXX_Merge ¶
func (m *RequestLabel) XXX_Merge(src proto.Message)
func (*RequestLabel) XXX_Size ¶
func (m *RequestLabel) XXX_Size() int
func (*RequestLabel) XXX_Unmarshal ¶
func (m *RequestLabel) XXX_Unmarshal(b []byte) error
type Version ¶ added in v1.1.0
Version is used to control proxy and cn version to keep them compatibility.
type VersionedExtraInfo ¶ added in v1.1.0
type VersionedExtraInfo struct { // Version defines the version of extra info. Version Version ExtraInfo ExtraInfo }
func NewVersionedExtraInfo ¶ added in v1.1.0
func NewVersionedExtraInfo(v Version, i ExtraInfo) *VersionedExtraInfo
NewVersionedExtraInfo creates a new ExtraInfo instance with specified version.
func (*VersionedExtraInfo) Decode ¶ added in v1.1.0
func (e *VersionedExtraInfo) Decode(reader *bufio.Reader) error
func (*VersionedExtraInfo) Encode ¶ added in v1.1.0
func (e *VersionedExtraInfo) Encode() ([]byte, error)