MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / writeCommandBuf

Method writeCommandBuf

IceFireDB-SQLProxy/pkg/mysql/client/req.go:19–33  ·  view source on GitHub ↗
(command byte, arg []byte)

Source from the content-addressed store, hash-verified

17}
18
19func (c *Conn) writeCommandBuf(command byte, arg []byte) error {
20 c.ResetSequence()
21
22 length := len(arg) + 1
23 data := utils.ByteSliceGet(length + 4)
24 data[4] = command
25
26 copy(data[5:], arg)
27
28 err := c.WritePacket(data)
29
30 utils.ByteSlicePut(data)
31
32 return err
33}
34
35func (c *Conn) writeCommandStr(command byte, arg string) error {
36 return c.writeCommandBuf(command, utils.StringToByteSlice(arg))

Callers 1

writeCommandStrMethod · 0.95

Calls 4

ResetSequenceMethod · 0.95
WritePacketMethod · 0.95
ByteSliceGetFunction · 0.92
ByteSlicePutFunction · 0.92

Tested by

no test coverage detected