Plumber Endpoint

Plumber Endpoint

Details

Defines a terminal handler in a PLumber router.

Parameters values are obtained from parsing blocks of lines in a plumber file. They can also be provided manually for historical reasons.

Super classes

plumber::hookable -> plumber::PlumberStep -> PlumberEndpoint

Public fields

verbs

a character vector. http methods. For historical reasons we have to accept multiple verbs for a single path. Now it's simpler to just parse each separate verb/path into its own endpoint, so we just do that.

path

a character string. endpoint path

comments

endpoint comments

responses

endpoint responses

params

endpoint parameters

tags

endpoint tags

Methods

Public methods

Inherited methods

Method getTypedParams()

retrieve endpoint typed parameters

Usage

PlumberEndpoint$getTypedParams()


Method canServe()

ability to serve request

Usage

PlumberEndpoint$canServe(req)

Arguments

req

a request object

Returns

a logical. TRUE when endpoint can serve request.


Method matchesPath()

determines if route matches requested path

Usage

PlumberEndpoint$matchesPath(path)

Arguments

path

a url path

Returns

a logical. TRUE when endpoint matches the requested path.


Method new()

Create a new PlumberEndpoint object

Usage

PlumberEndpoint$new(
  verbs,
  path,
  expr,
  envir,
  serializer,
  lines,
  params,
  comments,
  responses,
  tags
)

Arguments

verbs

endpoint verb

path

endpoint path

expr

endpoint expr

envir

endpoint environment

serializer

endpoint serializer

lines

endpoint block

params

endpoint params

comments

endpoint comments

responses

endpoint responses

tags

endpoint tags

Returns

A new PlumberEndpoint object


Method getPathParams()

retrieve endpoint path parameters

Usage

PlumberEndpoint$getPathParams(path)

Arguments

path

endpoint path


Method getFuncParams()

retrieve endpoint expression parameters

Usage

PlumberEndpoint$getFuncParams()


Method clone()

The objects of this class are cloneable with this method.

Usage

PlumberEndpoint$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.