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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user