Skip to content

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

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DaprStateStore(config?): DaprStateStore

Parameters

NameTypeDescription
config?Object-
config.cacheTtl?numberCache time to live in ms
config.clientConfig?DaprClientConfigThe Dapr client config to interact with Dapr sidecar
config.enableCache?booleanEnable cache
config.enableGet?booleanEnable generally get method
config.enableRemove?booleanEnable generally remove method
config.enableSet?booleanEnable generally set method
config.logLevel?LogLevelNameA log level for new logger if logger is not set
config.logger?LoggerA logger instance
config.stateStoreName?stringThe name of the state store

Returns

DaprStateStore

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

NameTypeDescription
cacheTtl?numberCache time to live in ms
clientConfig?DaprClientConfigThe Dapr client config to interact with Dapr sidecar
enableCache?booleanEnable cache
enableGet?booleanEnable generally get method
enableRemove?booleanEnable generally remove method
enableSet?booleanEnable generally set method
logLevel?LogLevelNameA log level for new logger if logger is not set
logger?LoggerA logger instance
stateStoreName?stringThe name of the state store

Inherited from

StateStoreBaseClass.config

Defined in

core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:16


logger

logger: Logger

Inherited from

StateStoreBaseClass.logger

Defined in

core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:15


name

name: string

Inherited from

StateStoreBaseClass.name

Defined in

core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:17

Methods

destroy

destroy(): Promise<void>

Returns

Promise<void>

Inherited from

StateStoreBaseClass.destroy

Defined in

core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:25


getState

getState<StateNames>(...stateNames): Promise<ObjectWithKeysFromStringArray<StateNames>>

Type parameters

NameType
StateNamesextends string[]

Parameters

NameType
...stateNamesStateNames

Returns

Promise<ObjectWithKeysFromStringArray<StateNames>>

Inherited from

StateStoreBaseClass.getState

Defined in

core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:20


getStateImpl

getStateImpl<StateNames>(...stateNames): Promise<ObjectWithKeysFromStringArray<StateNames>>

Type parameters

NameType
StateNamesextends string[]

Parameters

NameType
...stateNamesStateNames

Returns

Promise<ObjectWithKeysFromStringArray<StateNames>>

Overrides

StateStoreBaseClass.getStateImpl

Defined in

dapr-sdk/src/DaprStateStore/DaprStateStore.impl.ts:53


removeState

removeState(stateName): Promise<void>

Parameters

NameType
stateNamestring

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

NameType
stateNamestring

Returns

Promise<void>

Overrides

StateStoreBaseClass.removeStateImpl

Defined in

dapr-sdk/src/DaprStateStore/DaprStateStore.impl.ts:99


setState

setState(stateName, stateValue): Promise<void>

Parameters

NameType
stateNamestring
stateValueunknown

Returns

Promise<void>

Inherited from

StateStoreBaseClass.setState

Defined in

core/dist/commonjs/core/StateStore/StateStoreBaseClass.impl.d.ts:24


setStateImpl

setStateImpl(stateName, stateValue): Promise<void>

Parameters

NameType
stateNamestring
stateValueunknown

Returns

Promise<void>

Overrides

StateStoreBaseClass.setStateImpl

Defined in

dapr-sdk/src/DaprStateStore/DaprStateStore.impl.ts:82