{"id":26182487,"url":"https://github.com/IBM-Swift/Kitura-redis","last_synced_at":"2025-03-11T22:01:46.724Z","repository":{"id":54558999,"uuid":"51176810","full_name":"Kitura/Kitura-redis","owner":"Kitura","description":"Swift Redis library","archived":false,"fork":false,"pushed_at":"2023-08-03T20:56:44.000Z","size":732,"stargazers_count":94,"open_issues_count":11,"forks_count":25,"subscribers_count":34,"default_branch":"master","last_synced_at":"2024-05-13T14:59:36.606Z","etag":null,"topics":["client","database","redis","swift","swift-library"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kitura.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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":"2016-02-05T22:00:32.000Z","updated_at":"2024-05-13T14:59:48.197Z","dependencies_parsed_at":"2024-05-13T14:59:47.474Z","dependency_job_id":"3dc627a4-5df2-4d3e-a82e-8b8fb6ca2781","html_url":"https://github.com/Kitura/Kitura-redis","commit_stats":null,"previous_names":["ibm-swift/kitura-redis"],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitura%2FKitura-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitura%2FKitura-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitura%2FKitura-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitura%2FKitura-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kitura","download_url":"https://codeload.github.com/Kitura/Kitura-redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243119546,"owners_count":20239321,"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":["client","database","redis","swift","swift-library"],"created_at":"2025-03-11T22:01:28.675Z","updated_at":"2025-03-11T22:01:46.712Z","avatar_url":"https://github.com/Kitura.png","language":"Swift","funding_links":[],"categories":["Database Connectors"],"sub_categories":["Redis"],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"http://kitura.dev/\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/Kitura/Kitura/master/Sources/Kitura/resources/kitura-bird.svg?sanitize=true\" height=\"100\" alt=\"Kitura\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://kitura.github.io/Kitura-redis/index.html\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/apidoc-KituraRedis-1FBCE4.svg?style=flat\" alt=\"APIDoc\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/IBM-Swift/Kitura-redis\"\u003e\n    \u003cimg src=\"https://travis-ci.org/IBM-Swift/Kitura-redis.svg?branch=master\" alt=\"Build Status - Master\"\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/badge/os-macOS-green.svg?style=flat\" alt=\"macOS\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/os-linux-green.svg?style=flat\" alt=\"Linux\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-Apache2-blue.svg?style=flat\" alt=\"Apache 2\"\u003e\n    \u003ca href=\"http://swift-at-ibm-slack.mybluemix.net/\"\u003e\n    \u003cimg src=\"http://swift-at-ibm-slack.mybluemix.net/badge.svg\" alt=\"Slack Status\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n# KituraRedis\n\nKituraRedis is a pure Swift client for interacting with a Redis database.\n\n## Swift version\nThe latest version of Kitura-redis requires **Swift 4.0.3 or later**. You can download this version of the Swift binaries by following this [link](https://swift.org/download/). Compatibility with other Swift versions is not guaranteed.\n\n## Usage\n\n#### Add dependencies\n\nAdd the `Kitura-redis` package to the dependencies within your application’s `Package.swift` file. Substitute `\"x.x.x\"` with the latest `Kitura-redis` [release](https://github.com/Kitura/Kitura-redis/releases).\n\n```swift\n.package(url: \"https://github.com/Kitura/Kitura-redis.git\", from: \"x.x.x\")\n```\n\nAdd `SwiftRedis` to your target's dependencies:\n\n```swift\n.target(name: \"example\", dependencies: [\"SwiftRedis\"]),\n```\n\n#### Import package\n\n  ```swift\n  import SwiftRedis\n  ```\n\n## Redis installation\n\nTo test Kitura-redis locally you need to install [Redis](https://redis.io).\n\n### macOS\n```\nbrew install redis\n```\n\nTo start redis as a background service and have the service restarted at login:\n```\nbrew services start redis\n```\n\nOr, if you don't want redis running as a background service:\n```\nredis-server /usr/local/etc/redis.conf\n```\n\n## Example\n\nThis example shows you how to connect and make calls to Redis from Swift.\n\n#### Create simple Swift executable\n\nCreate a directory for this project, change into it and then initialize the project:\n```\n$ mkdir exampleRedis \u0026\u0026 cd exampleRedis\n$ swift package init --type executable\n```\n\nAdd Kitura-redis as a dependency as described above in \"Add dependencies\".\n\nNow, edit your `main.swift` file to contain:\n\n```swift\nimport Foundation\nimport SwiftRedis\n\nlet redis = Redis()\n\nredis.connect(host: \"localhost\", port: 6379) { (redisError: NSError?) in\n    if let error = redisError {\n        print(error)\n    }\n    else {\n        print(\"Connected to Redis\")\n        // Set a key\n        redis.set(\"Redis\", value: \"on Swift\") { (result: Bool, redisError: NSError?) in\n            if let error = redisError {\n                print(error)\n            }\n            // Get the same key\n            redis.get(\"Redis\") { (string: RedisString?, redisError: NSError?) in\n                if let error = redisError {\n                    print(error)\n                }\n                else if let string = string?.asString {\n                    print(\"Redis \\(string)\")\n                }\n            }\n        }\n    }\n}\n```\n\nNext, build the program and run it (either within Xcode or on the command line):\n```\n$ swift build\n$ .build/debug/redisExample\n```\n\nYou should see:\n```\n$ Connected to Redis\n$ Redis on Swift\n```\nThis shows that we've connected to Redis, set a string value for a key and then successfully retrieved the value for that key.\n\n## Contributing\n\nContributions to the Kitura-redis project are welcome.  You will want to be able to test your changes locally before submitting a pull request.\n\nThe tests require a Redis server to be accessible locally on the default port (6379).  If you do not wish to install Redis permanently, you can use Docker to run a temporary instance locally as follows:\n```\ndocker run -d -p 6379:6379 redis:alpine redis-server --requirepass password123\n```\nThe password specified above must match the one defined in `Tests/SwiftRedis/password.txt`.  Then you can run the tests as normal, either via Xcode or with:\n```\nswift test\n```\n\n## API Documentation\nFor more information visit our [API reference](https://kitura.github.io/Kitura-redis/index.html).\n\n## Community\n\nWe love to talk server-side Swift, and Kitura. Join our [Slack](http://swift-at-ibm-slack.mybluemix.net/) to meet the team!\n\n## License\nThis library is licensed under Apache 2.0. Full license text is available in [LICENSE](https://github.com/Kitura/Kitura-redis/blob/master/LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIBM-Swift%2FKitura-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIBM-Swift%2FKitura-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIBM-Swift%2FKitura-redis/lists"}