Skip to content

Type Method

secret(path:fileIO:on:)

Load the content of a file at a given path as a secret.
static func secret(path: String, fileIO: NonBlockingFileIO, on eventLoop: any EventLoop) -> EventLoopFuture<String?>

Parameters

path

Path to the file containing the secret

fileIO

NonBlockingFileIO handler provided by NIO

eventLoop

EventLoop for NIO to use for working with the file

Return Value

  • On success, a succeeded future with the loaded content of the file.

  • On any kind of error, a succeeded future with a value of nil. It is not currently possible to get error details.