Module utils

Source

Structs§

FileMetadata
WrappedSigner
To get around using a Box with ShadowDriveClient.

Constants§

FILE_UPLOAD_BATCH_SIZE
Maximum amount of files to batch into a single [store_files] request.

Functions§

get_text
Check with a HEAD that the URL exists and is a “text/plain” file. If so, return the response of a GET request.
last_modified
Pulls “last-modified” from HeaderMap, unaltered.
parse_filesize
Convert a file size string to Byte object with the denoted size.
process_shadow_api_response
Further diagnostic printing wherever possible.
pubkey_arg
Clap value parser for base58 string representations of Pubkey.
shadow_client_factory
We either create an authenticated client with default auth headers, or else we simply use the RpcClient provided by the normal ShadowDriveClient constructor.
shadow_file_with_basename
Factory function for a ShadowFile, where we just use the path’s basename. Panics if path.file_name() returns None.
storage_object_url
Generate a Shadow Drive file URL from storage account and filename.
wait_for_user_confirmation
Confirm from the user that they definitely want some irreversible operation to occur.