diff --git a/src/redis-shake/decode.go b/src/redis-shake/decode.go index 880a9d5..986f731 100644 --- a/src/redis-shake/decode.go +++ b/src/redis-shake/decode.go @@ -136,11 +136,25 @@ func (cmd *CmdDecode) decoderMain(ipipe <-chan *rdb.BinEntry, opipe chan<- strin return string(b) } 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) if err != nil { log.PanicError(err, "decode failed") } - var b bytes.Buffer switch obj := o.(type) { default: log.Panicf("unknown object %v", o)