RedShot

0.8.5

Lightweight & dependency-free Redis client for Swift
OperatorFoundation/Redshot

What's New

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.

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

Last updated: Fri Apr 12 2024 14:34:12 GMT-0900 (Hawaii-Aleutian Daylight Time)