PURISTA API / Modules / @purista/dapr-sdk / DaprStateStore
Class: DaprStateStore
@purista/dapr-sdk.DaprStateStore
DaprStateStore is an adapter which connects to the state store provided by the underlaying Dapr infrastructure
Hierarchy
StateStoreBaseClass
<DaprStateStoreConfig
>↳
DaprStateStore
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new DaprStateStore(config?
): DaprStateStore
Parameters
Name | Type | Description |
---|---|---|
config? | Object | - |
config.cacheTtl? | number | Cache time to live in ms |
config.clientConfig? | DaprClientConfig | The Dapr client config to interact with Dapr sidecar |
config.enableCache? | boolean | Enable cache |
config.enableGet? | boolean | Enable generally get method |
config.enableRemove? | boolean | Enable generally remove method |
config.enableSet? | boolean | Enable generally set method |
config.logLevel? | LogLevelName | A log level for new logger if logger is not set |
config.logger? | Logger | A logger instance |
config.stateStoreName? | string | The name of the state store |
Returns
Overrides
StateStoreBaseClass.constructor
Defined in
dapr-sdk/src/DaprStateStore/DaprStateStore.impl.ts:18
Properties
client
• Private
client: HttpClient
<DaprClientConfig
>
Defined in
dapr-sdk/src/DaprStateStore/DaprStateStore.impl.ts:16
config
• config: Object
Type declaration
Name | Type | Description |
---|---|---|
cacheTtl? | number | Cache time to live in ms |
clientConfig? | DaprClientConfig | The Dapr client config to interact with Dapr sidecar |
enableCache? | boolean | Enable cache |
enableGet? | boolean | Enable generally get method |
enableRemove? | boolean | Enable generally remove method |
enableSet? | boolean | Enable generally set method |
logLevel? | LogLevelName | A log level for new logger if logger is not set |
logger? | Logger | A logger instance |
stateStoreName? | string | The name of the state store |
Inherited from
Defined in
core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:16
logger
• logger: Logger
Inherited from
Defined in
core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:15
name
• name: string
Inherited from
Defined in
core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:17
Methods
destroy
▸ destroy(): Promise
<void
>
Returns
Promise
<void
>
Inherited from
Defined in
core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:25
getState
▸ getState<StateNames
>(...stateNames
): Promise
<ObjectWithKeysFromStringArray
<StateNames
>>
Type parameters
Name | Type |
---|---|
StateNames | extends string [] |
Parameters
Name | Type |
---|---|
...stateNames | StateNames |
Returns
Promise
<ObjectWithKeysFromStringArray
<StateNames
>>
Inherited from
Defined in
core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:20
getStateImpl
▸ getStateImpl<StateNames
>(...stateNames
): Promise
<ObjectWithKeysFromStringArray
<StateNames
>>
Type parameters
Name | Type |
---|---|
StateNames | extends string [] |
Parameters
Name | Type |
---|---|
...stateNames | StateNames |
Returns
Promise
<ObjectWithKeysFromStringArray
<StateNames
>>
Overrides
StateStoreBaseClass.getStateImpl
Defined in
dapr-sdk/src/DaprStateStore/DaprStateStore.impl.ts:53
removeState
▸ removeState(stateName
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
Returns
Promise
<void
>
Inherited from
StateStoreBaseClass.removeState
Defined in
core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:22
removeStateImpl
▸ removeStateImpl(stateName
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
Returns
Promise
<void
>
Overrides
StateStoreBaseClass.removeStateImpl
Defined in
dapr-sdk/src/DaprStateStore/DaprStateStore.impl.ts:99
setState
▸ setState(stateName
, stateValue
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
stateValue | unknown |
Returns
Promise
<void
>
Inherited from
Defined in
core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:24
setStateImpl
▸ setStateImpl(stateName
, stateValue
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
stateValue | unknown |
Returns
Promise
<void
>
Overrides
StateStoreBaseClass.setStateImpl