Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tommy351/rdb-go
Parse Redis RDB dump files.
https://github.com/tommy351/rdb-go
golang golang-library golang-package redis redis-tool
Last synced: 3 months ago
JSON representation
Parse Redis RDB dump files.
- Host: GitHub
- URL: https://github.com/tommy351/rdb-go
- Owner: tommy351
- License: mit
- Created: 2020-07-04T14:09:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-31T02:58:47.000Z (about 1 year ago)
- Last Synced: 2024-10-11T20:48:08.811Z (4 months ago)
- Topics: golang, golang-library, golang-package, redis, redis-tool
- Language: Go
- Homepage: https://pkg.go.dev/github.com/tommy351/rdb-go
- Size: 541 KB
- Stars: 22
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rdb-go
Parse Redis RDB dump files. This library is based on [redis-rdb-tools](https://github.com/sripathikrishnan/redis-rdb-tools).
[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/tommy351/rdb-go)](https://github.com/tommy351/rdb-go/releases) [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/tommy351/rdb-go) ![Test](https://github.com/tommy351/rdb-go/workflows/Test/badge.svg) [![codecov](https://codecov.io/gh/tommy351/rdb-go/branch/master/graph/badge.svg)](https://codecov.io/gh/tommy351/rdb-go)
## Install
This library can be used as a package.
```sh
go get github.com/tommy351/rdb-go
```Or as a command line tool.
```sh
go get github.com/tommy351/rdb-go/cmd/rdb
rdb path/to/dump.rdb
```## Usage
Use `Parser` to iterate over a RDB dump file.
```go
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](https://pkg.go.dev/github.com/tommy351/rdb-go) or [cmd/rdb/main.go](cmd/rdb/main.go) for more details.
## License
MIT