Skip to content

tommy351/rdb-go

Repository files navigation

rdb-go

Parse Redis RDB dump files. This library is based on redis-rdb-tools.

GitHub tag (latest SemVer) go.dev reference Test codecov

Install

This library can be used as a package.

go get github.com/tommy351/rdb-go

Or as a command line tool.

go get github.com/tommy351/rdb-go/cmd/rdb
rdb path/to/dump.rdb

Usage

Use Parser to iterate over a RDB dump file.

import (
  rdb "github.com/tommy351/rdb-go"
)

parser := NewParser(file)

for {
  data, err := parser.Next()

  if err == io.EOF {
    break
  }

  if err != nil {
    panic(err)
  }

  // ...
}

See examples in the documentation or cmd/rdb/main.go for more details.

License

MIT