Module spin_sdk.wit.imports.spin_redis_redis_3_0_0
Global variables
var Error-
Errors related to interacting with Redis
var RedisParameter-
A parameter type for the general-purpose
executefunction. var RedisResult-
A return type for the general-purpose
executefunction.
Classes
class Connection-
Expand source code
class Connection: @classmethod async def open(cls, address: str) -> Self: """ Open a connection to the Redis instance at `address`. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedError async def publish(self, channel: str, payload: bytes) -> None: """ Publish a Redis message to the specified channel. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedError async def get(self, key: str) -> Optional[bytes]: """ Get the value of a key. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedError async def set(self, key: str, value: bytes) -> None: """ Set key to value. If key already holds a value, it is overwritten. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedError async def incr(self, key: str) -> int: """ Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. An `error::type-error` is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedError async def del_(self, keys: List[str]) -> int: """ Removes the specified keys. A key is ignored if it does not exist. Returns the number of keys deleted. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedError async def sadd(self, key: str, values: List[str]) -> int: """ Add the specified `values` to the set named `key`, returning the number of newly-added values. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedError async def smembers(self, key: str) -> List[str]: """ Retrieve the contents of the set named `key`. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedError async def srem(self, key: str, values: List[str]) -> int: """ Remove the specified `values` from the set named `key`, returning the number of newly-removed values. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedError async def execute(self, command: str, arguments: List[RedisParameter]) -> List[RedisResult]: """ Execute an arbitrary Redis command and receive the result. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedError def __enter__(self) -> Self: """Returns self""" return self def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None: """ Release this resource. """ raise NotImplementedErrorStatic methods
async def open(address: str) ‑> Self-
Open a connection to the Redis instance at
address.Raises:
componentize_py_types.Err(Error)
Methods
async def del_(self, keys: List[str]) ‑> int-
Expand source code
async def del_(self, keys: List[str]) -> int: """ Removes the specified keys. A key is ignored if it does not exist. Returns the number of keys deleted. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedErrorRemoves the specified keys.
A key is ignored if it does not exist. Returns the number of keys deleted.
Raises:
componentize_py_types.Err(Error) async def execute(self,
command: str,
arguments: List[RedisParameter_Int64 | RedisParameter_Binary]) ‑> List[RedisResult_Nil | RedisResult_Status | RedisResult_Int64 | RedisResult_Binary]-
Expand source code
async def execute(self, command: str, arguments: List[RedisParameter]) -> List[RedisResult]: """ Execute an arbitrary Redis command and receive the result. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedErrorExecute an arbitrary Redis command and receive the result.
Raises:
componentize_py_types.Err(Error) async def get(self, key: str) ‑> bytes | None-
Expand source code
async def get(self, key: str) -> Optional[bytes]: """ Get the value of a key. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedErrorGet the value of a key.
Raises:
componentize_py_types.Err(Error) async def incr(self, key: str) ‑> int-
Expand source code
async def incr(self, key: str) -> int: """ Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. An `error::type-error` is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedErrorIncrements the number stored at key by one.
If the key does not exist, it is set to 0 before performing the operation. An
error::type-erroris returned if the key contains a value of the wrong type or contains a string that can not be represented as integer.Raises:
componentize_py_types.Err(Error) async def publish(self, channel: str, payload: bytes) ‑> None-
Expand source code
async def publish(self, channel: str, payload: bytes) -> None: """ Publish a Redis message to the specified channel. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedErrorPublish a Redis message to the specified channel.
Raises:
componentize_py_types.Err(Error) async def sadd(self, key: str, values: List[str]) ‑> int-
Expand source code
async def sadd(self, key: str, values: List[str]) -> int: """ Add the specified `values` to the set named `key`, returning the number of newly-added values. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedErrorAdd the specified
valuesto the set namedkey, returning the number of newly-added values.Raises:
componentize_py_types.Err(Error) async def set(self, key: str, value: bytes) ‑> None-
Expand source code
async def set(self, key: str, value: bytes) -> None: """ Set key to value. If key already holds a value, it is overwritten. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedErrorSet key to value.
If key already holds a value, it is overwritten.
Raises:
componentize_py_types.Err(Error) async def smembers(self, key: str) ‑> List[str]-
Expand source code
async def smembers(self, key: str) -> List[str]: """ Retrieve the contents of the set named `key`. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedErrorRetrieve the contents of the set named
key.Raises:
componentize_py_types.Err(Error) async def srem(self, key: str, values: List[str]) ‑> int-
Expand source code
async def srem(self, key: str, values: List[str]) -> int: """ Remove the specified `values` from the set named `key`, returning the number of newly-removed values. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.spin_redis_redis_3_0_0.Error)` """ raise NotImplementedErrorRemove the specified
valuesfrom the set namedkey, returning the number of newly-removed values.Raises:
componentize_py_types.Err(Error)
class Error_InvalidAddress-
Expand source code
@dataclass class Error_InvalidAddress: passError_InvalidAddress()
class Error_Other (value: str)-
Expand source code
@dataclass class Error_Other: value: strError_Other(value: str)
Instance variables
var value : str
class Error_TooManyConnections-
Expand source code
@dataclass class Error_TooManyConnections: passError_TooManyConnections()
class Error_TypeError-
Expand source code
@dataclass class Error_TypeError: passError_TypeError()
class RedisParameter_Binary (value: bytes)-
Expand source code
@dataclass class RedisParameter_Binary: value: bytesRedisParameter_Binary(value: bytes)
Instance variables
var value : bytes
class RedisParameter_Int64 (value: int)-
Expand source code
@dataclass class RedisParameter_Int64: value: intRedisParameter_Int64(value: int)
Instance variables
var value : int
class RedisResult_Binary (value: bytes)-
Expand source code
@dataclass class RedisResult_Binary: value: bytesRedisResult_Binary(value: bytes)
Instance variables
var value : bytes
class RedisResult_Int64 (value: int)-
Expand source code
@dataclass class RedisResult_Int64: value: intRedisResult_Int64(value: int)
Instance variables
var value : int
class RedisResult_Nil-
Expand source code
@dataclass class RedisResult_Nil: passRedisResult_Nil()
class RedisResult_Status (value: str)-
Expand source code
@dataclass class RedisResult_Status: value: strRedisResult_Status(value: str)
Instance variables
var value : str