Skip to content

Commit

Permalink
General overdue cleanups (#208)
Browse files Browse the repository at this point in the history
Bump Swift minimum to match Vapor, add platform versions, update README, general cleanup, fix imports, remove old Concurrency conditionals
  • Loading branch information
gwynne authored Mar 22, 2023
1 parent 394d957 commit d24cad7
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 53 deletions.
7 changes: 5 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// swift-tools-version:5.2
// swift-tools-version:5.5.2
import PackageDescription

let package = Package(
name: "redis",
platforms: [
.macOS(.v10_15)
.macOS(.v10_15),
.iOS(.v13),
.tvOS(.v13),
.watchOS(.v6),
],
products: [
.library(name: "Redis", targets: ["Redis"])
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://user-images.githubusercontent.com/1342803/60044372-33cc6100-9690-11e9-8ec4-d69afc3dccb1.png" alt="Redis">
<br>
<br>
<a href="https://docs.vapor.codes/3.0/">
<a href="https://docs.vapor.codes/4.0/">
<img src="http://img.shields.io/badge/read_the-docs-2196f3.svg" alt="Documentation">
</a>
<a href="https://discord.gg/vapor">
Expand All @@ -11,11 +11,11 @@
<a href="LICENSE">
<img src="http://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License">
</a>
<a href="https://circleci.com/gh/vapor/redis">
<img src="https://circleci.com/gh/vapor/redis.svg?style=shield" alt="Continuous Integration">
<a href="https://github.com/vapor/redis/actions/workflows/test.yml">
<img src="https://github.com/vapor/redis/actions/workflows/test.yml/badge.svg?event=push" alt="CI">
</a>
<a href="https://swift.org">
<img src="http://img.shields.io/badge/swift-5.0-brightgreen.svg" alt="Swift 5.0">
<img src="http://img.shields.io/badge/swift-5.5-brightgreen.svg" alt="Swift 5.5">
</a>

<span>This project is based off the Redis driver <a href="https://gitlab.com/Mordil/RediStack" target="_blank"><bold>RediStack</bold></a>. For the majority of API documentation, refer to <a href="https://docs.redistack.info" target="_blank">docs.redistack.info</a>.</span>
Expand Down
2 changes: 2 additions & 0 deletions Sources/Redis/Application+Redis.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Vapor
import RediStack
import NIOCore
import Logging

extension Application {
public struct Redis {
Expand Down
1 change: 1 addition & 0 deletions Sources/Redis/Redis+Cache.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Vapor
import Foundation
import RediStack
import NIOCore

// MARK: RedisCacheCoder

Expand Down
8 changes: 1 addition & 7 deletions Sources/Redis/Redis+Concurrency.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#if compiler(>=5.5) && canImport(_Concurrency)
import NIOCore
import Vapor
import RediStack
import Foundation

@available(macOS 12, iOS 15, watchOS 8, tvOS 15, *)
extension Application.Redis {
public func send(command: String, with arguments: [RESPValue]) async throws -> RESPValue {
try await self.application.redis(self.id)
Expand Down Expand Up @@ -55,7 +54,6 @@ extension Application.Redis {
}
}

@available(macOS 12, iOS 15, watchOS 8, tvOS 15, *)
extension RedisClient {
/// Gets the provided key as a decodable type.
public func get<D>(_ key: RedisKey, asJSON type: D.Type) async throws -> D?
Expand All @@ -80,7 +78,6 @@ extension RedisClient {
}
}

@available(macOS 12, iOS 15, watchOS 8, tvOS 15, *)
extension Request.Redis {
public func send(command: String, with arguments: [RESPValue]) async throws -> RESPValue {
try await self.request.application.redis(self.id)
Expand Down Expand Up @@ -132,6 +129,3 @@ extension Request.Redis {
.get()
}
}


#endif
1 change: 1 addition & 0 deletions Sources/Redis/Redis+Sessions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation
import Vapor
import RediStack
import NIOCore

/// A delegate object that controls key behavior of an `Application.Redis.Sessions` driver.
public protocol RedisSessionsDelegate {
Expand Down
1 change: 1 addition & 0 deletions Sources/Redis/RedisClient+Codable.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AsyncKit
import Foundation
import RediStack
import NIOCore

extension RedisClient {
/// Gets the provided key as a decodable type.
Expand Down
2 changes: 2 additions & 0 deletions Sources/Redis/Request+Redis.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Vapor
import RediStack
import Logging
import NIOCore

extension Request {
public struct Redis {
Expand Down
1 change: 1 addition & 0 deletions Tests/RedisTests/MultipleRedisTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Redis
import Vapor
import Logging
import XCTVapor
import XCTest

private extension RedisID {
static let one: RedisID = "one"
Expand Down
1 change: 1 addition & 0 deletions Tests/RedisTests/RedisTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Vapor
import Logging
import XCTVapor
import RediStack
import XCTest

extension String {
var int: Int? { Int(self) }
Expand Down
27 changes: 0 additions & 27 deletions circle.yml

This file was deleted.

13 changes: 0 additions & 13 deletions docker-compose.yml

This file was deleted.

0 comments on commit d24cad7

Please sign in to comment.