jvmMain.assembly.RaptorKtorComponent.kt Maven / Gradle / Ivy
package io.fluidsonic.raptor.ktor
import io.fluidsonic.raptor.*
public class RaptorKtorComponent internal constructor() : RaptorComponent.Base(RaptorKtorPlugin) {
internal fun complete(context: RaptorContext) =
RaptorKtorInternal(
configuration = KtorConfiguration(
servers = componentRegistry.oneOrNull(Keys.serversComponent)?.complete().orEmpty(),
),
context = context,
)
@RaptorDsl
public val servers: RaptorKtorServersComponent
get() = componentRegistry.oneOrRegister(Keys.serversComponent, ::RaptorKtorServersComponent)
}
@RaptorDsl
public val RaptorAssemblyQuery.servers: RaptorAssemblyQuery
get() = map { it.servers }