Class: MockStorage

"mock-storage".MockStorage

Storage layer implemented with in-memory hashmap, to be used for testing.

Hierarchy

  • MockStorage

Implements

  • IStorage

Properties

data

Private data: Map<string, { content: string ; state: ContentState ; timestamp: number }> = new Map()

Defined in request-client.js/src/mock-storage.ts:10


forceEmitError

Private forceEmitError: boolean = false

Defined in request-client.js/src/mock-storage.ts:16

Methods

_getStatus

_getStatus(detailed?: boolean): Promise<any>

Defined in request-client.js/src/mock-storage.ts:137

Gets information

Parameters:

NameTypeDescription
detailed?booleanif true get the list of files hash

Returns: Promise<any>


_ipfsAdd

_ipfsAdd(content: string): Promise<IIpfsMeta>

Defined in request-client.js/src/mock-storage.ts:22

Parameters:

NameType
contentstring

Returns: Promise<IIpfsMeta>


_makeNextAppendFailInsteadOfConfirmed

_makeNextAppendFailInsteadOfConfirmed(): void

Defined in request-client.js/src/mock-storage.ts:150

Returns: void


append

append(content: string): Promise<IAppendResult>

Defined in request-client.js/src/mock-storage.ts:42

Parameters:

NameType
contentstring

Returns: Promise<IAppendResult>


getData

getData(): Promise<IEntriesWithLastTimestamp>

Defined in request-client.js/src/mock-storage.ts:109

Returns: Promise<IEntriesWithLastTimestamp>


getIgnoredData

getIgnoredData(): Promise<IEntry[]>

Defined in request-client.js/src/mock-storage.ts:128

Returns: Promise<IEntry[]>


initialize

initialize(): Promise<void>

Defined in request-client.js/src/mock-storage.ts:18

Returns: Promise<void>


read

read(id: string): Promise<IEntry>

Defined in request-client.js/src/mock-storage.ts:86

Parameters:

NameType
idstring

Returns: Promise<IEntry>


readMany

readMany(ids: string[]): Promise<IEntry[]>

Defined in request-client.js/src/mock-storage.ts:105

Parameters:

NameType
idsstring[]

Returns: Promise<IEntry[]>