Description Details Public fields Methods
Create a kelp object for interacting with SeaweedFS.
Create a kelp object for interacting with SeaweedFS.
This is a slightly higher level abstraction than seaweed_master()
and
seaweed_volume()
.
seaweed_url
Base URL for seaweed master.
new()
Create client object for sending http requests to seaweed
kelp$new(seaweed_url)
seaweed_url
Root URL of Seaweed
A new kelp
object
upload_file()
Upload file to SeaweedFS
kelp$upload_file(path, collection = NULL)
path
Path to file to be uploaded
collection
Collection name, acts as a namespace for files.
The uploaded file ID.
download_file()
Download file from SeaweedFS
If called with an id
matching an R object uploaded via
kelp$upload_object()
then this will download raw bytes from SeaweedFS which can
be converted back to R object at later point using unserialize
or readRDS
.
kelp$download_file(id, path = tempfile(), collection = NULL)
id
SeaweedFS file ID to read
path
Path to download file to
collection
Optional collection name this file belongs to.
The file contents
upload_object()
Upload arbitrary R object to SeaweedFS.
This serializes R object to raw vector of bytes and then
saves bytes to SeaweedFS. To recover R object as saved use
seaweed_volume$download_object()
kelp$upload_object(object, collection = NULL)
object
Object to be uploaded
collection
Collection name, acts as a namespace.
The uploaded file ID.
download_object()
Download arbitrary R object from SeaweedFS
If data downloaded from SeaweedFS is not unserializable (i.e. it was
written using
kelp$upload_file()
) then
this will throw an error. See
kelp$download_file()
to download as a file.
kelp$download_object(id, collection = NULL)
id
SeaweedFS file ID to download
collection
Optional collection name this file belongs to.
The R object.
upload_raw()
Upload vector of raw bytes to SeaweedFS.
kelp$upload_raw(raw, collection = NULL)
raw
Object to be uploaded
collection
Collection name, acts as a namespace.
The uploaded file ID.
download_raw()
Download vector of raw bytes from SeaweedFS
kelp$download_raw(id, collection = NULL)
id
SeaweedFS file ID to download
collection
Optional collection name this file belongs to.
Vector of raw bytes.
delete()
Delete file from SeaweedFS
kelp$delete(id, collection = NULL)
id
SeaweedFS file ID to delete
collection
Optional collection name this file belongs to.
This helps speedup lookup - only the single id will be deleted.
See
kelp$delete_collection()
to remove an entire
collection.
Nothing, called for side effects
delete_collection()
Delete a collection of files
kelp$delete_collection(collection)
collection
Collection name.
Nothing, called for side effects
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.