Class AbstractPreferenceStore
Properties
Private ctx
ctx: HandlerContext
Methods
delete
- delete(key: string, options?: object): Promise<void>
-
Parameters
-
key: string
-
Default value options: object = {}
-
Optional scope?: PreferenceScope | string
Returns Promise<void>
Protected Abstract doDelete
- doDelete(key: string, namespace: string): Promise<void>
-
Parameters
-
key: string
-
namespace: string
Returns Promise<void>
Protected Abstract doGet
- doGet(key: string, namespace: string): Promise<Preference | undefined>
-
Parameters
-
key: string
-
namespace: string
Returns Promise<Preference | undefined>
Protected Abstract doList
Protected Abstract doPut
-
Parameters
Returns Promise<void>
get
- get<V>(key: string, options?: object): Promise<V | undefined>
-
Type parameters
Parameters
-
key: string
-
Default value options: object = {}
-
Optional defaultValue?: V
-
Optional scope?: PreferenceScope | string
Returns Promise<V | undefined>
list
- list<V>(scope: PreferenceScope | string): Promise<Array<object>>
-
Type parameters
Parameters
-
scope: PreferenceScope | string
Returns Promise<Array<object>>
put
- put<V>(key: string, value: V, options?: object): Promise<V>
-
Type parameters
Parameters
-
key: string
-
value: V
-
Default value options: object = {}
-
Optional scope?: PreferenceScope | string
-
Optional ttl?: number
Returns Promise<V>
Protected scope
- scope(scope: PreferenceScope | string): string
-
Parameters
-
scope: PreferenceScope | string
Returns string
Protected scopeKey
- scopeKey(key: string, scope?: string): string
-
Parameters
-
key: string
-
Optional scope: string
Returns string
Abstract PreferenceStore implementation to handle ttl and key scoping