Browse Source

checks pass

master
boB Rudis 1 year ago
parent
commit
e923d22cab
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
4 changed files with 16 additions and 5 deletions
  1. +1
    -0
      .Rbuildignore
  2. +6
    -3
      R/resolver.R
  3. +8
    -1
      man/gdns_query.Rd
  4. +1
    -1
      man/gdns_resolver.Rd

+ 1
- 0
.Rbuildignore View File

@@ -13,3 +13,4 @@
^tmp$
^notes$
^\.gitlab-ci\.yml$
^CONDUCT\.md$

+ 6
- 3
R/resolver.R View File

@@ -1,7 +1,7 @@
#' Create a gdns DNS over TLS context and populate it with a resolver
#' for use in resolution functions
#'
#' @param resolver character vector of valid DNS over TLS resolvers;
#' @param resolvers character vector of valid DNS over TLS resolvers;
#' Defaults to Quad9 (`9.9.9.9`).
#' @export
#' @examples
@@ -109,15 +109,18 @@ gdns_resolver <- function(resolvers = "9.9.9.9") {
#' - `x25`
#' - `zonemd`
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @param name an entity to query for
#' @param rr_type what resource record type do you want to queyr for? See `Details`.
#' @references <https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml>
#' @export
#' @examples
#' x <- gdns_resolver()
#' gdns_query(x, "example.com")
gdns_query <- function(gcx, name, rr_type = "txt") {
gdns_query <- function(gctx, name, rr_type = "txt") {

rr_type <- match.arg(trimws(tolower(rr_type[1])), names(rr_types))
res <- int_gdns_query(gcx, name, unname(as.integer(rr_types[rr_type])))
res <- int_gdns_query(gctx, name, unname(as.integer(rr_types[rr_type])))
if (length(res)) {
out <- jsonlite::fromJSON(res)
out


+ 8
- 1
man/gdns_query.Rd View File

@@ -4,7 +4,14 @@
\alias{gdns_query}
\title{Arbitrary DNS queries}
\usage{
gdns_query(gcx, name, rr_type = "txt")
gdns_query(gctx, name, rr_type = "txt")
}
\arguments{
\item{gctx}{gdns resolver context created with \code{\link[=gdns_resolver]{gdns_resolver()}}}

\item{name}{an entity to query for}

\item{rr_type}{what resource record type do you want to queyr for? See \code{Details}.}
}
\description{
Perform any valid resource record inquiry for a given name. See \code{Details}.


+ 1
- 1
man/gdns_resolver.Rd View File

@@ -8,7 +8,7 @@ for use in resolution functions}
gdns_resolver(resolvers = "9.9.9.9")
}
\arguments{
\item{resolver}{character vector of valid DNS over TLS resolvers;
\item{resolvers}{character vector of valid DNS over TLS resolvers;
Defaults to Quad9 (\code{9.9.9.9}).}
}
\description{


Loading…
Cancel
Save