1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Add cache writing

This commit is contained in:
ofekshenawa
2024-03-03 11:20:05 +02:00
parent e9b162945b
commit 05aae206bb
10 changed files with 118 additions and 46 deletions

View File

@ -40,6 +40,8 @@ const (
const Nil = RedisError("redis: nil") // nolint:errname
var Line []byte
type RedisError string
func (e RedisError) Error() string { return string(e) }
@ -120,7 +122,7 @@ func (r *Reader) ReadLine() ([]byte, error) {
if IsNilReply(line) {
return nil, Nil
}
Line = line
return line, nil
}
@ -151,6 +153,10 @@ func (r *Reader) readLine() ([]byte, error) {
return b[:len(b)-2], nil
}
func (r *Reader) GetLine() []byte {
return Line
}
func (r *Reader) ReadReply() (interface{}, error) {
line, err := r.ReadLine()
if err != nil {