Package-level declarations

Types

Link copied to clipboard
sealed class AppNameConstraint

A constraint for retrieving modules related to some application in getKtorModulesByPriority.

Link copied to clipboard
abstract class KtorApplication(scope: InjectionScope, val appName: String? = null) : TegralService

Superclass for Ktor applications that use Tegral Web Application.

Link copied to clipboard
class KtorApplicationSettings<TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration>(val engine: ApplicationEngineFactory<TEngine, TConfiguration>, val port: Int = 80, val host: String = "0.0.0.0", val watchPaths: List<String> = listOf(File(".").canonicalPath), configure: TConfiguration.() -> Unit = {})

Application settings for the Ktor application. Identical to the parameters of the embeddedServer function from Ktor.

Link copied to clipboard
abstract class KtorController(priority: Int = DEFAULT_CONTROLLER_PRIORITY, val restrictToAppName: String? = null) : KtorModule

Identical to KtorModule, but allows you to directly add routes, as if calling routing in a KtorModule.

Link copied to clipboard
class KtorExtension(scope: InjectionScope, enableFundefs: Boolean = false) : DeclarationsProcessor

The Ktor extension object that is injected into the meta-environment. Keeps track of implementations of KtorModule subclasses (incl. KtorController subclasses) within the main environment.

Link copied to clipboard
abstract class KtorModule(val moduleInstallationPriority: Int = DEFAULT_MODULE_PRIORITY, val restrictToAppName: String? = null)

A Ktor module that will be automatically installed to a corresponding KtorApplication with a matching app name.

Link copied to clipboard
data class WebControllersConfig(var enableFundefs: Boolean = false)

Configuration object for WebControllersFeature.

Link copied to clipboard

Feature object for Tegral Web Controllers.

Functions

Link copied to clipboard

Utility functions that filters declarations to only those that are subclasses of KtorModule, and returns a properly typed list for them.

Link copied to clipboard
fun InjectionEnvironment.getKtorModulesByPriority(allIdentifiers: List<Identifier<out KtorModule>>, appNameConstraint: AppNameConstraint, additionalModules: List<KtorModule>): List<KtorModule>
fun InjectionEnvironment.getKtorModulesByPriority(allIdentifiers: List<Identifier<out KtorModule>>, appName: String?, additionalModules: List<KtorModule>): List<KtorModule>

Retrieves all implementations of KtorModule subclasses in the given environment, sorted by decreasing priority.