Skip to content

Commit f795940

Browse files
author
Stefan Fleck
committed
first draft doc for BackupQueue
1 parent 1453ace commit f795940

File tree

2 files changed

+129
-0
lines changed

2 files changed

+129
-0
lines changed

R/BackupQueue.R

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,70 @@
99
#' As of now, **the R6 API is still under development and subject to change**.
1010
#' More documentation will follow in the foreseable future.
1111
#'
12+
#'
13+
#' @section Methods:
14+
#'
15+
#' \describe{
16+
#' \item{`pad_index()`}{Pad the indices in the filenames of indexed backups
17+
#' to the number of digits of the largest index. Usually does not have to
18+
#' be called manually.
19+
#' }
20+
#'
21+
#' \item{`prune()`}{Delet all backups except `max_backups`. See [prune_backups()]}
22+
#'
23+
#' \item{`push_backup() <BackupQueueIndex>`}{
24+
#' Create a new backup with index 1, push back all other indices.
25+
#' Always calls `$prune()` before it terminates.
26+
#' }
27+
#'
28+
#' \item{`push_backup(overwrite = FALSE, now = Sys.time()) <BackupQueueDate> <BackupQueueDateteime>`}{
29+
#' Create a new backup with a timestamp. The `now` paramter override the
30+
#' real system time. If `overwrite` is `TRUE` exisiting backups with the
31+
#' same filename (i.e timestamp) are overwritten. Always calls
32+
#' `$prune()` before it terminates.
33+
#' }
34+
#'
35+
#' \item{`backup_dir`, `set_backup_dir(x)`}{
36+
#' `character` scalar. Set a directory in which to place the backups
37+
#' }
38+
#'
39+
#' \item{`cache_backups`, `set_cache_backups(x)`}{
40+
#' `TRUE` or `FALSE`. If `TRUE` (the default) the list of backups is cached,
41+
#' if `FALSE` it is read from disk every time this appender triggers.
42+
#' Caching brings a significant speedup for checking whether to rotate or
43+
#' not based on the `age` of the last backup, but is only safe if
44+
#' there are no other programs/functions (except this appender) interacting
45+
#' with the backups.
46+
#' }
47+
#'
48+
#' \item{`compression`, `set_compression`}{See `compression` argument of [rotate()]}
49+
#'
50+
#' \item{`file`, `set_file(x)`}{`character` scalar. The file to backup/rotate}
51+
#'
52+
#' \item{`fmt`, `set_fmt(x)`}{
53+
#' `character` scalar. See `format` argument of [rotate_date()]
54+
#' }
55+
#'
56+
#' \item{`max_backups`, `set_max_backups(x)`}{
57+
#' See `max_backups` argument of [rotate()]
58+
#' }
59+
#'
60+
#' \item{`should_rotate(size) <BackupQueueIndex>`}{
61+
#' Should a file of `size` be rotated? See `size` argument of [`rotate()`]
62+
#' }
63+
#'
64+
#' \item{`should_rotate(size, age, now = Sys.time(), last_rotation = self$last_rotation) <BackupQueueDate> <BackupQueueDateteime>`}{
65+
#' Should a file of `size` and `age` be rotated? See `size` and `age`
66+
#' arguments of [`rotate_date()`]. `now` overrides the current system time,
67+
#' `last_rotation`` overrieds the date of the last rotation.
68+
#' }
69+
#'
70+
#' \item{`update_backups_cache()`}{
71+
#' Force update of the backups_bache. Only does something if `$cache_backups`
72+
#' is `TRUE`.
73+
#' }
74+
#' }
75+
#'
1276
#' @eval r6_usage(list(BackupQueueIndex, BackupQueueDate, BackupQueueDateTime))
1377
#' @name BackupQueue
1478
#' @aliases BackupQueueIndex BackupQueueDateTime BackupQueueDate

man/BackupQueue.Rd

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)