目录
目录README.md

RedShot

RedShot is a minimalistic Swift client library for the Redis database.

Redshot is dependency free.

Language Swift 4 Platforms CircleCI

Getting started

To add RedShot in your projects.

Add this in your Package.swift :

.Package(url: "https://github.com/bermudadigitalstudio/Redshot.git", majorVersion: 0)

You can connect to Redis by instantiating the Redis class :

import RedShot

let redis = try Redis(hostname: "localhost", port: 6379)

To connect to a password protected Redis instance, use:

let redis = try Redis(hostname: "localhost", port: 6379, password: "mypassword")

The Redis class exposes methods that are named identical to the commands they execute. The arguments these methods accept are often identical to the arguments specified on the Redis website. For instance, SET and GET commands can be called like this:

try redis.set(key: "mycounter", value: "479")

let myCounter = try redis.get(key: "mycounter") 
print(myCounter)

Running Unit Tests

RedShot’s unit test require a running Redis database with a password.

Redis instance can be launch with Docker :

docker run -d -p 6379:6379 redis:latest --requirepass password123

Defaults

  • host: "localhost"
  • port: 6379

Source Code Linting

The source code is formatted using SwiftLint and all commits & PRs need to be without any SwiftLint warnings or errors.

License

RedShot is released under the MIT License.

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号