PluginBuilder

abstract class PluginBuilder<PluginConfig : Any>

A utility class to build an ApplicationPlugin instance.

Inheritors

Properties

Link copied to clipboard
abstract val application: Application

A reference to the Application where the plugin is installed.

Link copied to clipboard

A configuration of your current application (incl. host, port and anything else you can define in application.conf).

Link copied to clipboard

Allows you to access the environment of the currently running application where the plugin is installed.

Link copied to clipboard

A configuration of the current plugin.

Functions

Link copied to clipboard
fun <HookHandler> on(hook: Hook<HookHandler>, handler: HookHandler)

Specifies a handler for a specific hook. A hook can be a specific place in time or event during the request processing like application shutdown, an exception during call processing, etc.

Link copied to clipboard
fun onCall(block: suspend OnCallContext<PluginConfig>.(call: PipelineCall) -> Unit)

Specifies the block handler for every incoming PipelineCall.

Link copied to clipboard
fun onCallReceive(block: suspend OnCallReceiveContext<PluginConfig>.(call: PipelineCall, body: Any) -> Unit)

Specifies the block handler that allows you to obtain and transform data received from the client. This block is invoked for every attempt to receive the request body.

Link copied to clipboard
fun onCallRespond(block: suspend OnCallRespondContext<PluginConfig>.(call: PipelineCall, body: Any) -> Unit)

Specifies the block handler that allows you to transform data before sending it to the client. This handler is executed when the call.respond function is invoked in a route handler.