{"id":13805048,"url":"https://github.com/xiusin/vredis","last_synced_at":"2025-09-01T18:09:18.157Z","repository":{"id":188231149,"uuid":"612860395","full_name":"xiusin/vredis","owner":"xiusin","description":"The Redis client is a software tool that allows you to connect to a Redis database over the network, send commands, and receive responses.","archived":false,"fork":false,"pushed_at":"2025-05-15T14:02:52.000Z","size":98,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T15:25:08.281Z","etag":null,"topics":["vlang","vlang-module"],"latest_commit_sha":null,"homepage":"","language":"V","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiusin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2023-03-12T07:33:55.000Z","updated_at":"2025-05-15T14:03:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f43ef7e-922b-435c-96c2-d527779e106b","html_url":"https://github.com/xiusin/vredis","commit_stats":null,"previous_names":["xiusin/vredis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xiusin/vredis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiusin%2Fvredis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiusin%2Fvredis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiusin%2Fvredis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiusin%2Fvredis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiusin","download_url":"https://codeload.github.com/xiusin/vredis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiusin%2Fvredis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273167790,"owners_count":25057262,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["vlang","vlang-module"],"created_at":"2024-08-04T01:00:56.894Z","updated_at":"2025-09-01T18:09:18.115Z","avatar_url":"https://github.com/xiusin.png","language":"V","funding_links":[],"categories":["Libraries"],"sub_categories":["Database clients"],"readme":"# VRedis\n\nVRedis is a Redis client service written in the V programming language. It allows you to connect to a Redis database over the network, send commands, and receive responses. Please note that this project is currently under **development** and is not recommended for use in production projects.\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/xiusin/vredis)\n\n\n\u003e Almost support all Redis commands.\n\n# Installation\n\nBefore using VRedis, you will need to install the V programming language compiler. Please visit the [V language website](https://vlang.io) for installation instructions. Once you have installed the V compiler, you can install VRedis using the following command:\n\n```vlang\nv install xiusin.vredis\n```\n\n# Usage\n\nUsing VRedis is straightforward. First, you need to import the vredis module:\n\n\n```vlang\nimport xiusin.vredis\n```\n\nOnce you have successfully connected, you can send commands using the `send()` method and receive responses using the `recv()` method:\n\n```vlang\nredis := vredis.new_client(host: '127.0.0.1', port: 6379, db: 1, name: 'vclient', requirepass: '')\n\n// or pool\nmut pool := new_pool(\n\tdial: fn () !\u0026Redis {\n\t\treturn new_client()!\n\t}\n\tmax_active: 2\n\tmax_conn_life_time: 1\n\ttest_on_borrow: fn (mut conn ActiveRedisConn) ! {\n\t\tconn.ping()!\n\t}\n)\n\nmut redis := pool.get()!\ndefer {\n    redis.release() // You must execute this function, otherwise it will result in a memory leak.\n}\n\n\nredis.set(\"mykey\", \"hello\")!\nredis.keys('*')!\nredis.del('mykey')!\nredis.hset('website', 'api', 'api.vlang.io')!\nredis.zadd('sets', 1, 'v1', '2', 'v2')!\n\n// For more usage, please refer to the test cases.\n\nredis.flushall()!\n```\n\n# Redis Pub/Sub Subscribe to Multiple Channels Example\n\nThis example demonstrates how to use the redis.psubscribe function in Redis to subscribe to multiple channels and receive messages that match specified patterns.\n```v\nredis.psubscribe(['chan*', 'order*', 'sms*'], fn (pattern string, chan string, message string) ! {\n    println('pattern: ${pattern} \tchan: ${chan} -\u003e message: ${message}')\n})!\n\n// You must use a new instance because the above instance is blocked.\nredis1.publish('chan1', 'to chan1')!\nredis1.publish('order1', 'to chan1')!\nredis1.publish('sms1', 'to chan1')!\n```\n\n\nFinally, when you are finished with the connection, use the close() method to close it:\n\n```vlang\nredis.close()\n// or\nredis.release() // pool mode\n```\n\n# Contributing\n\nIf you are interested in VRedis and would like to contribute to it, feel free to submit issues or pull requests to our code repository on GitHub: https://github.com/xiusin/vredis\n\n# License\n\nVRedis is licensed under the MIT License. See the LICENSE file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiusin%2Fvredis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiusin%2Fvredis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiusin%2Fvredis/lists"}