Skip to content

RedisAdapter

The Redis storage adapter.

Extends

Type parameters

Type parameter
K extends ConnectionTypes

Constructors

new RedisAdapter()

1
new RedisAdapter<K>(data: object | object | object): RedisAdapter<K>

Builds up the Redis storage adapter.

Parameters

ParameterTypeDescription
dataobject | object | objectThe data for the redis connection.

Returns

RedisAdapter<K>

Overrides

StorageAdapter.constructor

Source

twitchfy/packages/eventsub/src/storage/adapters/RedisAdapter.ts:20

Properties

PropertyModifierType
clientpublicRedis

Methods

delete()

1
delete(id: string): Promise<void>

Deletes a subscription from the storage.

Parameters

ParameterTypeDescription
idstringThe id of the subscription which will be deleted.

Returns

Promise<void>

Overrides

StorageAdapter.delete

Source

twitchfy/packages/eventsub/src/storage/adapters/RedisAdapter.ts:55


get()

1
get<T>(id: string): Promise<StorageAdapterGet<K, T>>

Gets a subscription from the storage.

Type parameters

Type parameterValue
T extends SubscriptionTypesSubscriptionTypes

Parameters

ParameterTypeDescription
idstringThe id of the subscription which will be get.

Returns

Promise<StorageAdapterGet<K, T>>

The basic data which will be needed to reload the subscription. You can attach other data to the object.

Overrides

StorageAdapter.get

Source

twitchfy/packages/eventsub/src/storage/adapters/RedisAdapter.ts:49


getAll()

1
getAll(): Promise<StorageAdapterGet<K, SubscriptionTypes>[]>

Gets all subscriptions from the storage.

Returns

Promise<StorageAdapterGet<K, SubscriptionTypes>[]>

Overrides

StorageAdapter.getAll

Source

twitchfy/packages/eventsub/src/storage/adapters/RedisAdapter.ts:63


set()

1
set<T>(id: string, subscription: SubscriptionType<T, K>): Promise<void>

Sets a subscription into the storage.

Type parameters

Type parameterValue
T extends SubscriptionTypesSubscriptionTypes

Parameters

ParameterTypeDescription
idstringThe id of the subscription which will be set. Probably you want to use the id as a key.
subscriptionSubscriptionType<T, K>The subscription which will be set.

Returns

Promise<void>

Overrides

StorageAdapter.set

Source

twitchfy/packages/eventsub/src/storage/adapters/RedisAdapter.ts:28