Package-level declarations

Types

Link copied to clipboard
class Application : ApplicationCallPipeline, CoroutineScope

Represents configured and running web application, capable of handling requests. It is also the application coroutine scope that is cancelled immediately at application stop so useful for launching background coroutines.

Link copied to clipboard
interface ApplicationCall : CoroutineScope

A single act of communication between a client and server.

Link copied to clipboard
open class ApplicationCallPipeline(val developmentMode: Boolean = false, val environment: ApplicationEnvironment) : Pipeline<Unit, PipelineCall>

Pipeline configuration for executing PipelineCall instances.

Link copied to clipboard
expect interface ApplicationEnvironment

Represents an environment in which Application runs

actual interface ApplicationEnvironment
actual interface ApplicationEnvironment

Represents an environment in which Application runs

actual interface ApplicationEnvironment
Link copied to clipboard

Provides events for Application lifecycle.

Link copied to clipboard

Defines a Plugin that is installed into Application.

Link copied to clipboard

Defines a Plugin that is installed into Application.

Link copied to clipboard
Link copied to clipboard

The context associated with the call that is currently being processed by server. Every call handler (PluginBuilder.onCall, PluginBuilder.onCallReceive, PluginBuilder.onCallRespond, and so on) of your plugin has a derivative of CallContext as a receiver.

Link copied to clipboard

Thrown on an attempt to install the plugin with the same key as for the already installed plugin.

Link copied to clipboard

Thrown on an attempt to install the plugin with the same key as for the already installed plugin.

Link copied to clipboard

Definition of an event. Event is used as a key so both hashCode and equals need to be implemented properly. Inheriting of this class is an experimental plugin. Instantiate directly if inheritance not necessary.

Link copied to clipboard

Specifies signature for the event handler.

Link copied to clipboard
interface Hook<HookHandler>

A hook that can be registered in PluginBuilder.

Link copied to clipboard

An exception that is thrown when the current body in the HTTP pipeline is invalid.

Link copied to clipboard

Thrown on an attempt to access the plugin that is not yet installed.

Link copied to clipboard

A context associated with the call handling by your application. OnCallContext is a receiver for PluginBuilder.onCall handler of your PluginBuilder.

Link copied to clipboard

A context associated with the call.receive() action. Allows you to transform the received body. OnCallReceiveContext is a receiver for PluginBuilder.onCallReceive handler of your PluginBuilder.

Link copied to clipboard

A context associated with the call.respond() action. Allows you to transform the response body. OnCallRespondContext is a receiver for PluginBuilder.onCallRespond handler of your PluginBuilder.

Link copied to clipboard

A single act of communication between a client and server.

Link copied to clipboard

Defines an installable Plugin.

Link copied to clipboard
abstract class PluginBuilder<PluginConfig : Any>

A utility class to build an ApplicationPlugin instance.

Link copied to clipboard

An instance of the plugin installed to your application.

Link copied to clipboard

Defines a Plugin that can be installed into RoutingNode

Link copied to clipboard
Link copied to clipboard

Core configuration for a running server. Contains modules, paths, and environment details.

Link copied to clipboard

A builder for ServerConfig.

Link copied to clipboard
class TransformBodyContext(val requestedType: TypeInfo?)

Contains type information about the current request or response body when performing a transformation.

Properties

Link copied to clipboard

Current application for the context

Link copied to clipboard

Event definition for Application Started event

Link copied to clipboard

Event definition for Application Starting event

Link copied to clipboard

Event definition for Application Stopped event

Link copied to clipboard

Event definition for Application Stopping event

Link copied to clipboard

Event definition for an event that is fired when the application is going to stop

Link copied to clipboard

Convenience extension property for pipeline interceptors with Application call contexts.

Current call for the context

Link copied to clipboard

The host address of the currently running application, as defined by the configuration at start-up.

Link copied to clipboard

Indicates if a response is sent.

Link copied to clipboard

Convenience property to access log from application

Link copied to clipboard

Returns the existing plugin registry or registers and returns a new one.

Link copied to clipboard

The port the current application is running on, as defined by the configuration at start-up.

Link copied to clipboard

The TypeInfo recorded from the last call.receive() call.

Link copied to clipboard

Fired when the server is ready to accept connections

Functions

Link copied to clipboard
fun <PluginConfigT : Any> createApplicationPlugin(name: String, configurationPath: String, createConfiguration: (config: ApplicationConfig) -> PluginConfigT, body: PluginBuilder<PluginConfigT>.() -> Unit): ApplicationPlugin<PluginConfigT>

Creates an ApplicationPlugin that can be installed into an Application.

Link copied to clipboard
fun <F : Any> RoutingNode.findPluginInRoute(plugin: Plugin<*, *, F>): F?

Finds the plugin F in the current RoutingNode. If not found, search in the parent RoutingNode.

Link copied to clipboard
fun <P : RoutingNode, B : Any, F : Any> P.install(plugin: BaseApplicationPlugin<P, B, F>, configure: B.() -> Unit = {}): F
fun <P : Pipeline<*, PipelineCall>, B : Any, F : Any> P.install(plugin: Plugin<P, B, F>, configure: B.() -> Unit = {}): F

Installs a plugin into this pipeline, if it is not yet installed.

Link copied to clipboard
fun <A : Pipeline<*, PipelineCall>, F : Any> A.plugin(plugin: Plugin<*, *, F>): F

Gets a plugin instance for this pipeline, or fails with MissingApplicationPluginException if the plugin is not installed.

Link copied to clipboard
fun <A : Pipeline<*, PipelineCall>, F : Any> A.pluginOrNull(plugin: Plugin<*, *, F>): F?

Returns a plugin instance for this pipeline, or null if the plugin is not installed.

Link copied to clipboard
fun serverConfig(environment: ApplicationEnvironment = applicationEnvironment {}, block: ServerConfigBuilder.() -> Unit = {}): ServerConfig

Creates an ServerConfig instance.

Link copied to clipboard
fun <A : Pipeline<*, PipelineCall>, B : Any, F : Any> A.uninstall(plugin: Plugin<A, B, F>)

Uninstalls a plugin from the pipeline.

Link copied to clipboard

Uninstalls all plugins from the pipeline.

Link copied to clipboard

Uninstalls a plugin specified by key from the pipeline.