hfhbd
@KtorDsl val myPlugin = createRouteScopedPlugin("myPlugin, ::Config) {}
@KtorDsl class Config
this@routing.install
this@routing.get
Aleksei Tirman [JB]
Rustam Siniukov
@KtorDsl val RateLimit = createRouteScopedPlugin("RateLimit, ::Config) {} @KtorDsl class Config routing { get { call.respondText { "42" } } route("/login") { this@routing.install(RateLimit) { this@route.get { call.respondText { "/login called" } } } } }
KtorDsl
@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPEALIAS, AnnotationTarget.TYPE, AnnotationTarget.FUNCTION)
val RateLimit = createRouteScopedPlugin("RateLimit, ::Config) {}
@KtorDsl fun RateLimit(requiredParameter) = createRouteScopedPlugin(...)
install
this
get
A modern programming language that makes developers happier.