MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / writeRedisBulkString

Function writeRedisBulkString

internal/api/redis_queue_protocol.go:511–526  ·  view source on GitHub ↗
(writer *bufio.Writer, payload []byte)

Source from the content-addressed store, hash-verified

509}
510
511func writeRedisBulkString(writer *bufio.Writer, payload []byte) error {
512 if writer == nil {
513 return net.ErrClosed
514 }
515 if payload == nil {
516 return writeRedisNilBulkString(writer)
517 }
518 if _, errWrite := writer.WriteString("$" + strconv.Itoa(len(payload)) + "\r\n"); errWrite != nil {
519 return errWrite
520 }
521 if _, errWrite := writer.Write(payload); errWrite != nil {
522 return errWrite
523 }
524 _, errWrite := writer.WriteString("\r\n")
525 return errWrite
526}
527
528func writeRedisArrayOfBulkStrings(writer *bufio.Writer, items [][]byte) error {
529 if writer == nil {

Callers 6

handleRedisConnectionMethod · 0.85
writeRedisPubSubMessageFunction · 0.85
writeRedisPubSubPongFunction · 0.85

Calls 3

writeRedisNilBulkStringFunction · 0.85
WriteStringMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected