Redis
This library provides a Wing client for Redis.
Installation
Use npm to install this library:
npm i @winglibs/redis
Bring it
The redis.Redis resource represents a Redis client.
bring redis;
let redis  = new redis.Redis();
new cloud.Function(inflight () => {
    redis.set("mykey", "myvalue");
});
Use it
The redis.Redis resource provides the following inflight methods:
- get- Gets a value from the Redis server.
- set- Sets a value on the Redis server.
- del- Deletes a value from the Redis server.
- hGet- Gets a value from a hash on the Redis server.
- hSet- Sets a value on a hash on the Redis server.
- sAdd- Adds a value to a set on the Redis server.
- sMembers- Gets all members of a set on the Redis server.
sim
When executed in the Wing Simulator, a Redis server is started within a local Docker container.
tf-aws
Coming soon.
Roadmap
- Support for the Wing Simulator
- Support for AWS
- Support for GCP
- Support for Azure
Maintainers
License
Licensed under the MIT License.
API Reference
Table of Contents
- Classes
- Interfaces
Util (preflight class) 
No description
Constructor
new(): Util
Properties
No properties
Methods
| Signature | Description | 
|---|---|
| static inflight newRedisClient(url: str, redisPassword: str): IRedisClient | No description | 
Redis (preflight class) 
No description
Constructor
new(): Redis
Properties
No properties
Methods
| Signature | Description | 
|---|---|
| inflight del(key: str): void? | No description | 
| inflight get(key: str): str? | No description | 
| inflight hGet(key: str, field: str): str? | No description | 
| inflight hSet(key: str, field: str, value: str): void? | No description | 
| inflight sAdd(key: str, value: str): void? | No description | 
|  | No description | 
| inflight set(key: str, value: str): void? | No description | 
| inflight url(): str | No description | 
Redis_sim (preflight class) 
No description
Constructor
new(): Redis_sim
Properties
No properties
Methods
| Signature | Description | 
|---|---|
| inflight del(key: str): void | No description | 
| inflight get(key: str): str? | No description | 
| inflight hGet(key: str, field: str): str? | No description | 
| inflight hSet(key: str, field: str, value: str): void | No description | 
| inflight sAdd(key: str, value: str): void | No description | 
|  | No description | 
| inflight set(key: str, value: str): void | No description | 
| inflight url(): str | No description | 
IRedis (interface) 
No description
Properties
No properties
Methods
| Signature | Description | 
|---|---|
| inflight del(key: str): void | No description | 
| inflight get(key: str): str? | No description | 
| inflight hGet(key: str, field: str): str? | No description | 
| inflight hSet(key: str, field: str, value: str): void | No description | 
| inflight sAdd(key: str, value: str): void | No description | 
|  | No description | 
| inflight set(key: str, value: str): void | No description | 
| inflight url(): str | No description | 
IRedisClient (interface) 
No description
Properties
No properties
Methods
| Signature | Description | 
|---|---|
| inflight connect(): void | No description | 
| inflight del(key: str): void | No description | 
| inflight disconnect(): void | No description | 
| inflight get(key: str): str? | No description | 
| inflight hGet(key: str, field: str): str? | No description | 
| inflight hSet(key: str, field: str, value: str): void | No description | 
| inflight sAdd(key: str, value: str): void | No description | 
|  | No description | 
| inflight set(key: str, value: str): void | No description | 
| inflight url(): str | No description |