KtorGenCompanionExtFactory

@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class KtorGenCompanionExtFactory(val name: String = "create")(source)

Whether to generate a create(client) extension function of interface's companion object.

This requires the annotation to be placed on the companion itself or declared a companion object explicit.

Example:

interface UserRoute {
@KtorGenCompanionExtFactory
companion object
}
fun UserRoute.Companion.create(client): UserRoute =
UserRouteImpl(httpClient = client)

Parameters

name

The name of the function to generate. Defaults to create.

Properties

Link copied to clipboard