All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.assembly.RaptorKtorServersComponent.kt Maven / Gradle / Ivy

package io.fluidsonic.raptor.ktor

import io.fluidsonic.raptor.*


public class RaptorKtorServersComponent internal constructor() :
	RaptorComponent.Base(RaptorKtorPlugin),
	RaptorComponentSet {

	@RaptorDsl
	override val all: RaptorAssemblyQuery
		get() = componentRegistry.all(Keys.serverComponent).all


	internal fun complete(): Collection =
		componentRegistry.many(Keys.serverComponent).map { it.complete() }


	@RaptorDsl
	public fun new(forceEncryptedConnection: Boolean = true): RaptorKtorServerComponent =
		componentRegistry.register(Keys.serverComponent, RaptorKtorServerComponent(forceEncryptedConnection = forceEncryptedConnection))


	@RaptorDsl
	public fun new(forceEncryptedConnection: Boolean = true, configure: RaptorKtorServerComponent.() -> Unit = {}) {
		new(forceEncryptedConnection = forceEncryptedConnection).configure()
	}
}


@RaptorDsl
public fun RaptorAssemblyQuery.new(
	forceEncryptedConnection: Boolean = true,
): RaptorAssemblyQuery =
	map { it.new(forceEncryptedConnection = forceEncryptedConnection) }


@RaptorDsl
public fun RaptorAssemblyQuery.new(
	forceEncryptedConnection: Boolean = true,
	configure: RaptorKtorServerComponent.() -> Unit = {},
) {
	this {
		new(forceEncryptedConnection = forceEncryptedConnection).configure()
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy