| DataStoragePlumber | R Documentation |
Implementation of the DataStorage R6 class to SQLite backend using a unified
API for read/write operations
shiny.telemetry::DataStorage -> DataStoragePlumber
event_read_endpointstring field that returns read action endpoint
event_insert_endpointstring field that returns insert action endpoint
new()Initialize the data storage class
DataStoragePlumber$new( hostname = "127.0.0.1", port = 80, protocol = "http", path = NULL, secret = NULL, authorization = NULL )
hostnamestring with hostname of plumber instance,
portnumeric value with port number of plumber instance.
protocolstring with protocol of the connection of the plumber instance.
pathstring with sub-path of plumber deployment.
secretstring with secret to sign communication with plumber (can be NULL for disabling communication signing).
authorizationstring to use in HTTP headers for authorization (for example: to authenticate to a plumber deployment behind a connect server).
clone()The objects of this class are cloneable with this method.
DataStoragePlumber$clone(deep = FALSE)
deepWhether to make a deep clone.
## Not run:
# Make sure the PLUMBER_SECRET environment variable is valid before
# running these examples (NULL or a valid secret)
data_storage <- DataStoragePlumber$new(
hostname = "connect.appsilon.com",
path = "shiny_telemetry_plumber",
port = 443,
protocol = "https",
authorization = Sys.getenv("CONNECT_AUTHORIZATION_KEY"),
secret = Sys.getenv("PLUMBER_SECRET")
)
data_storage <- DataStoragePlumber$new(
hostname = "127.0.0.1",
path = NULL,
port = 8087,
protocol = "http",
secret = Sys.getenv("PLUMBER_SECRET")
)
data_storage$insert("example", "test_event", "session1")
data_storage$insert("example", "input", "s1", list(id = "id"))
data_storage$insert("example", "input", "s1", list(id = "id2", value = 32))
data_storage$insert(
"example", "test_event_3_days_ago", "session1",
time = lubridate::as_datetime(lubridate::today() - 3)
)
data_storage$read_event_data()
data_storage$read_event_data(Sys.Date() - 1, Sys.Date() + 1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.