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
Name | Type |
---|---|
yagnaApi | YagnaApi |
options | WebSocketStorageProviderOptions |
Returns
WebSocketBrowserStorageProvider
Defined in
Methods
close
▸ close(): Promise
<void
>
Close storage provider and release all resources.
Returns
Promise
<void
>
Implementation of
Defined in
init
▸ init(): Promise
<void
>
Initialize storage provider.
Returns
Promise
<void
>
Implementation of
Defined in
publishData
▸ publishData(data
): Promise
<string
>
Return allocated resource URL from Yagna of data to be uploaded.
Parameters
Name | Type |
---|---|
data | Uint8Array |
Returns
Promise
<string
>
Implementation of
Defined in
publishFile
▸ publishFile(): Promise
<string
>
Return allocated resource URL from Yagna of a file to be uploaded.
Returns
Promise
<string
>
Implementation of
Defined in
receiveData
▸ receiveData(callback
): Promise
<string
>
Return allocated resource URL from Yagna of a file to be downloaded.
Parameters
Name | Type |
---|---|
callback | StorageProviderDataCallback |
Returns
Promise
<string
>
Implementation of
Defined in
receiveFile
▸ receiveFile(): Promise
<string
>
Return allocated resource URL from Yagna of a file to be downloaded.
Returns
Promise
<string
>
Implementation of
Defined in
release
▸ release(urls
): Promise
<void
>
Release previously allocated resource URL from Yagna.
Parameters
Name | Type |
---|---|
urls | string [] |
Returns
Promise
<void
>