{"id":29124327,"url":"https://github.com/vczyh/redis-lib","last_synced_at":"2025-06-29T20:07:31.225Z","repository":{"id":205753637,"uuid":"714978970","full_name":"vczyh/redis-lib","owner":"vczyh","description":"Redis develop tools, implemented by pure Go.","archived":false,"fork":false,"pushed_at":"2024-09-12T06:40:12.000Z","size":78,"stargazers_count":21,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-12T16:24:38.441Z","etag":null,"topics":["aof","go","golang","library","rdb","redis","redis-rep","redis-sync"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vczyh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-06T08:37:58.000Z","updated_at":"2024-09-12T06:40:15.000Z","dependencies_parsed_at":"2023-11-08T11:30:28.013Z","dependency_job_id":"90e7452b-60e3-4503-a058-3ac9aaf68993","html_url":"https://github.com/vczyh/redis-lib","commit_stats":null,"previous_names":["vczyh/redis-lib"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/vczyh/redis-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vczyh%2Fredis-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vczyh%2Fredis-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vczyh%2Fredis-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vczyh%2Fredis-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vczyh","download_url":"https://codeload.github.com/vczyh/redis-lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vczyh%2Fredis-lib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262660010,"owners_count":23344441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aof","go","golang","library","rdb","redis","redis-rep","redis-sync"],"created_at":"2025-06-29T20:07:29.360Z","updated_at":"2025-06-29T20:07:31.186Z","avatar_url":"https://github.com/vczyh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis lib\n\n## Features\n\n- [Create connection with Redis server](#creating-connection)\n- [Parse RDB file](#parsing-rdb)\n- [Fake replica, sync RDB and AOF with master](#faking-replica)\n\n## Compatibility\n\n- Support Redis 6 / 7\n\n## Installing\n\n```shell\ngo get github.com/vczyh/redis-lib\n```\n\n## Creating Connection\n\n```go  \nc, _ := client.NewClient(\u0026client.Config{  \n    Host:     \"127.0.0.1\",  \n    Port:     26379,  \n    Username: \"\",  \n    Password: \"123\",  \n})  \n\n_ = c.Auth()\n\n_ = c.Ping()\n```  \n\n## Parsing RDB\n\n```go  \np, _ := rdb.NewParser(\"/tmp/rdb_test.rdb\")  \n\ns, _ := p.Parse()  \n\nfor s.HasNext() {  \n    e := s.Next()  \n  \n    switch e.EventType {  \n    case rdb.EventTypeVersion:  \n       e.Event.Debug()  \n    case rdb.EventTypeStringObject:  \n       e.Event.Debug()  \n    case rdb.EventTypeSetObject:  \n       e.Event.Debug()  \n    }  \n}  \n  \n_ = s.Err()\n\n=== VersionEvent ===\n9\n\n=== StringObjectEvent ===\nKey: b\nValue: 3\n\n=== SetObjectEvent ===\nKey: key:set\nSize: 4\nMembers:\n        s2\n        s5\n        s4\n        s1\n        \n...\n```  \n\n## Faking Replica\n\n```go  \nr, _ := replica.NewReplica(\u0026replica.Config{  \n    MasterIP:            \"127.0.0.1\",  \n    MasterPort:          26379,  \n    MasterUser:          \"\",  \n    MasterPassword:      \"123\",  \n    MasterReplicaOffset: 67528,  \n    RdbWriter:           os.Stdout,  \n    AofWriter:           os.Stdout,  \n})  \n_ = r.SyncWithMaster()\n```\n\nsynchronize data and parse RDB:\n\n```go\nrdbReader, rdbWriter := io.Pipe()  \n  \nr, _ := replica.NewReplica(\u0026replica.Config{  \n    MasterIP:       \"127.0.0.1\",  \n    MasterPort:     26379,  \n    MasterUser:     \"\",  \n    MasterPassword: \"123\",  \n    RdbWriter:      rdbWriter,  \n    AofWriter:      os.Stdout,  \n})  \n  \ngo func() {  \n    _ = parseRdb(rdbReader)\n}()  \n  \n_ = r.SyncWithMaster()\n\nfunc parseRdb(r io.Reader) error {  \n    p, err := rdb.NewReaderParser(r)  \n    if err != nil {  \n       return err  \n    }  \n    s, err := p.Parse()  \n    if err != nil {  \n       return err  \n    }  \n    for s.HasNext() {  \n       e := s.Next()  \n       e.Event.Debug()  \n    }  \n    return s.Err()  \n}\n```\n\n## Star History\n\n\u003ca href=\"https://star-history.com/#vczyh/redis-lib\u0026Date\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=vczyh/redis-lib\u0026type=Date\u0026theme=dark\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=vczyh/redis-lib\u0026type=Date\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=vczyh/redis-lib\u0026type=Date\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvczyh%2Fredis-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvczyh%2Fredis-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvczyh%2Fredis-lib/lists"}