RedisResponse

public enum RedisResponse

A raw response from a Redis server

  • An array response from a Redis server. The value is an array of the individual responses that made up the array response.

    Declaration

    Swift

    case Array([RedisResponse])
  • An error from the Redis server.

    Declaration

    Swift

    case Error(String)
  • An Integer value returned from the Redis server.

    Declaration

    Swift

    case IntegerValue(Int64)
  • Nil

    A Null response returned from the Redis server.

    Declaration

    Swift

    case Nil
  • A status response (Simple string, OK) returned from the Redis server.

    Declaration

    Swift

    case Status(String)
  • A Bulk string response returned from the Redis server.

    Declaration

    Swift

    case StringValue(RedisString)
  • Extract an array response from the RedisResponse enum

    Returns

    An array of RedisResponse enums or nil, if the Redis response wasn’t an array response.

    Declaration

    Swift

    public var asArray: [RedisResponse]?

    Return Value

    An array of RedisResponse enums or nil, if the Redis response wasn’t an array response.

  • Extract an error response from the RedisResponse enum

    Returns

    The error message as a String or nil, if the Redis response wasn’t an error response.

    Declaration

    Swift

    public var asError: String?

    Return Value

    The error message as a String or nil, if the Redis response wasn’t an error response.

  • Extract an Integer response from the RedisResponse enum

    Returns

    The response as a Int64 or nil, if the Redis response wasn’t an Integer response.

    Declaration

    Swift

    public var asInteger: Int64?

    Return Value

    The response as a Int64 or nil, if the Redis response wasn’t an Integer response.

  • Extract a Simple String response from the RedisResponse enum

    Returns

    The response as a String or nil, if the Redis response wasn’t a Simple String response.

    Declaration

    Swift

    public var asStatus: String?

    Return Value

    The response as a String or nil, if the Redis response wasn’t a Simple String response.

  • Extract a Bulk String response from the RedisResponse enum

    Returns

    The response as a String or nil, if the Redis response wasn’t a Bulk String response.

    Declaration

    Swift

    public var asString: RedisString?

    Return Value

    The response as a String or nil, if the Redis response wasn’t a Bulk String response.