|
|
@ -136,11 +136,25 @@ func (cmd *CmdDecode) decoderMain(ipipe <-chan *rdb.BinEntry, opipe chan<- strin |
|
|
|
return string(b) |
|
|
|
return string(b) |
|
|
|
} |
|
|
|
} |
|
|
|
for e := range ipipe { |
|
|
|
for e := range ipipe { |
|
|
|
|
|
|
|
var b bytes.Buffer |
|
|
|
|
|
|
|
if e.Type == rdb.RdbFlagAUX && string(e.Key) == "lua" { |
|
|
|
|
|
|
|
o := &struct { |
|
|
|
|
|
|
|
Type string `json:"type"` |
|
|
|
|
|
|
|
Key string `json:"key"` |
|
|
|
|
|
|
|
Value64 string `json:"value64"` |
|
|
|
|
|
|
|
}{ |
|
|
|
|
|
|
|
"aux", "lua", string(e.Value), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
fmt.Fprintf(&b, "%s\n", toJson(o)) |
|
|
|
|
|
|
|
cmd.nentry.Incr() |
|
|
|
|
|
|
|
opipe <- b.String() |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
o, err := rdb.DecodeDump(e.Value) |
|
|
|
o, err := rdb.DecodeDump(e.Value) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.PanicError(err, "decode failed") |
|
|
|
log.PanicError(err, "decode failed") |
|
|
|
} |
|
|
|
} |
|
|
|
var b bytes.Buffer |
|
|
|
|
|
|
|
switch obj := o.(type) { |
|
|
|
switch obj := o.(type) { |
|
|
|
default: |
|
|
|
default: |
|
|
|
log.Panicf("unknown object %v", o) |
|
|
|
log.Panicf("unknown object %v", o) |
|
|
|