A component repo served as raw files under a base URL. Requires httr2 (>= 1.2.2).
See mighty_repo() for the component layout. .mustache is tried before
.R, and <name>/ before files directly under url. The first found is
used. Status 404 and 410 count as not found; other errors are raised.
name is percent-encoded, and names containing / are not found.
Responses are not cached.
Listing components (see list_components()) requires an HTML directory
index at <url>/, and at <url>/<dir>/ for nested components, e.g. Apache
or nginx autoindex, or python -m http.server. Listing aborts if an index
is unavailable or not HTML.
Transient errors (see httr2::req_retry()) and network failures are
retried. The number of attempts is set by the max_tries option, and
each attempt is limited by the timeout option (see
mighty.component-options).
Examples
repo <- mighty_repo_url(
url = paste0(
"https://raw.githubusercontent.com/",
"NovoNordisk-OpenSource/mighty.standards/main/components"
)
)
format(repo)
#> [1] "url::https://raw.githubusercontent.com/NovoNordisk-OpenSource/mighty.standards/main/components"
if (FALSE) { # interactive() && rlang::is_installed("httr2", version = "1.2.2")
find_component(component = "dummy", repos = repo)
}
