JS API Reference

Class: WebSocketBrowserStorageProvider

storage/ws-browser.WebSocketBrowserStorageProvider

Storage provider that uses GFTP over WebSockets.

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new WebSocketBrowserStorageProvider(yagnaApi, options): WebSocketBrowserStorageProvider

Parameters

NameType
yagnaApiYagnaApi
optionsWebSocketStorageProviderOptions

Returns

WebSocketBrowserStorageProvider

Defined in

src/storage/ws-browser.ts:62

Methods

close

close(): Promise<void>

Close storage provider and release all resources.

Returns

Promise<void>

Implementation of

StorageProvider.close

Defined in

src/storage/ws-browser.ts:69


init

init(): Promise<void>

Initialize storage provider.

Returns

Promise<void>

Implementation of

StorageProvider.init

Defined in

src/storage/ws-browser.ts:73


publishData

publishData(data): Promise<string>

Return allocated resource URL from Yagna of data to be uploaded.

Parameters

NameType
dataUint8Array

Returns

Promise<string>

Implementation of

StorageProvider.publishData

Defined in

src/storage/ws-browser.ts:77


publishFile

publishFile(): Promise<string>

Return allocated resource URL from Yagna of a file to be uploaded.

Returns

Promise<string>

Implementation of

StorageProvider.publishFile

Defined in

src/storage/ws-browser.ts:102


receiveData

receiveData(callback): Promise<string>

Return allocated resource URL from Yagna of a file to be downloaded.

Parameters

NameType
callbackStorageProviderDataCallback

Returns

Promise<string>

Implementation of

StorageProvider.receiveData

Defined in

src/storage/ws-browser.ts:106


receiveFile

receiveFile(): Promise<string>

Return allocated resource URL from Yagna of a file to be downloaded.

Returns

Promise<string>

Implementation of

StorageProvider.receiveFile

Defined in

src/storage/ws-browser.ts:132


release

release(urls): Promise<void>

Release previously allocated resource URL from Yagna.

Parameters

NameType
urlsstring[]

Returns

Promise<void>

Implementation of

StorageProvider.release

Defined in

src/storage/ws-browser.ts:136