Skip to content

Commit

Permalink
KTOR-6501 Add feedback link to KDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
e5l committed Jan 31, 2025
1 parent 255ce5e commit 4c710ae
Show file tree
Hide file tree
Showing 752 changed files with 7,956 additions and 21 deletions.
2 changes: 2 additions & 0 deletions build-logic/src/main/kotlin/ktorbuild/CInterop.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
* )
* }
* ```
*
* [Report a problem](https://ktor.io/feedback/?fqname=ktorbuild.createCInterop)
*/
@Suppress("UnstableApiUsage")
fun KotlinMultiplatformExtension.createCInterop(
Expand Down
10 changes: 9 additions & 1 deletion build-logic/src/main/kotlin/ktorbuild/KtorBuildExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ abstract class KtorBuildExtension(
/**
* The JDK version to be used to build the project.
* By default, the minimal supported JDK version is used.
*
* [Report a problem](https://ktor.io/feedback/?fqname=ktorbuild.KtorBuildExtension.jvmToolchain)
*/
val jvmToolchain: Property<JavaLanguageVersion> =
objects.property<JavaLanguageVersion>()
Expand All @@ -54,13 +56,19 @@ abstract class KtorBuildExtension(
*
* For example, to run tests against JDK 8, run a test task with flag "-Ptest.jdk=8"
* or put this property to `gradle.properties`.
*
* [Report a problem](https://ktor.io/feedback/?fqname=ktorbuild.KtorBuildExtension.jvmTestToolchain)
*/
val jvmTestToolchain: Provider<JavaLanguageVersion> =
providers.gradleProperty("test.jdk")
.orElse(providers.provider { JavaVersion.current().majorVersion })
.map(JavaLanguageVersion::of)

/** Host operating system. */
/**
* Host operating system.
*
* [Report a problem](https://ktor.io/feedback/?fqname=ktorbuild.KtorBuildExtension.os)
*/
val os: Provider<OperatingSystem> = providers.provider { buildPlatform.operatingSystem }

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import org.jetbrains.kotlin.konan.target.REMOVED_TARGET_MESSAGE

private typealias GroupedSourceSets = MutableMap<String, MutableSet<String>>

/** Constructs a new [KotlinHierarchyTemplate] tracking added targets and groups using the provided [tracker]. */
/**
* Constructs a new [KotlinHierarchyTemplate] tracking added targets and groups using the provided [tracker].
*
* [Report a problem](https://ktor.io/feedback/?fqname=ktorbuild.internal.TrackedKotlinHierarchyTemplate)
*/
@Suppress("FunctionName")
fun TrackedKotlinHierarchyTemplate(
tracker: KotlinHierarchyTracker,
Expand Down
10 changes: 9 additions & 1 deletion build-logic/src/main/kotlin/ktorbuild/targets/KtorTargets.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ import javax.inject.Inject
* ```
*
* See the full list of targets and target groups in [KtorTargets.hierarchyTemplate].
*
* [Report a problem](https://ktor.io/feedback/?fqname=ktorbuild.targets.KtorTargets)
*/
abstract class KtorTargets internal constructor(
private val layout: ProjectLayout,
Expand Down Expand Up @@ -85,6 +87,8 @@ abstract class KtorTargets internal constructor(
*
* For sub-targets (e.g., 'js.browser'), the state is inherited from the parent target
* unless explicitly configured in `gradle.properties`.
*
* [Report a problem](https://ktor.io/feedback/?fqname=ktorbuild.targets.KtorTargets.isEnabled)
*/
fun isEnabled(target: String): Boolean = targetStates.getOrPut(target) {
// Sub-targets inherit parent state
Expand Down Expand Up @@ -162,7 +166,11 @@ abstract class KtorTargets internal constructor(
}
}

/** Returns targets corresponding to the provided [sourceSet]. */
/**
* Returns targets corresponding to the provided [sourceSet].
*
* [Report a problem](https://ktor.io/feedback/?fqname=ktorbuild.targets.KtorTargets.Companion.resolveTargets)
*/
fun resolveTargets(sourceSet: String): Set<String> = hierarchyTracker.groups[sourceSet] ?: setOf(sourceSet)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import io.ktor.client.engine.*
* ```
*
* You can learn more about client engines from [Engines](https://ktor.io/docs/http-client-engines.html).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.Android)
*/
public data object Android : HttpClientEngineFactory<AndroidEngineConfig> {
override fun create(block: AndroidEngineConfig.() -> Unit): HttpClientEngine =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ private val METHODS_WITHOUT_BODY = listOf(HttpMethod.Get, HttpMethod.Head)

/**
* An Android client engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidClientEngine)
*/
@OptIn(InternalAPI::class)
public class AndroidClientEngine(override val config: AndroidEngineConfig) : HttpClientEngineBase("ktor-android") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,39 @@ import javax.net.ssl.*

/**
* A configuration for the [Android] client engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidEngineConfig)
*/
public class AndroidEngineConfig : HttpClientEngineConfig() {
/**
* Specifies a time period (in milliseconds) in which a client should establish a connection with a server.
*
* Set this value to `0` to use an infinite timeout.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidEngineConfig.connectTimeout)
*/
public var connectTimeout: Int = 100_000

/**
* Specifies a maximum time (in milliseconds) of inactivity between two data packets when exchanging data with a server.
*
* Set this value to `0` to use an infinite timeout.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidEngineConfig.socketTimeout)
*/
public var socketTimeout: Int = 100_000

/**
* Allows you to configure [HTTPS](https://ktor.io/docs/client-ssl.html) settings for this engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidEngineConfig.sslManager)
*/
public var sslManager: (HttpsURLConnection) -> Unit = {}

/**
* Allows you to set engine-specific request configuration.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidEngineConfig.requestConfig)
*/
public var requestConfig: HttpURLConnection.() -> Unit = {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import io.ktor.client.engine.*
* ```
*
* You can learn more about client engines from [Engines](https://ktor.io/docs/http-client-engines.html).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.Apache)
*/
public data object Apache : HttpClientEngineFactory<ApacheEngineConfig> {
override fun create(block: ApacheEngineConfig.() -> Unit): HttpClientEngine {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,74 @@ import javax.net.ssl.SSLContext

/**
* A configuration for the [Apache] client engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig)
*/
public class ApacheEngineConfig : HttpClientEngineConfig() {
/**
* Specifies whether to follow redirects automatically.
* Disabled by default.
*
* _Note: By default, the Apache client allows `50` redirects._
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.followRedirects)
*/
public var followRedirects: Boolean = false

/**
* Specifies a maximum time (in milliseconds) of inactivity between two data packets when exchanging data with a server.
*
* Set this value to `0` to use an infinite timeout.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.socketTimeout)
*/
public var socketTimeout: Int = 10_000

/**
* Specifies a time period (in milliseconds) in which a client should establish a connection with a server.
*
* A `0` value represents an infinite timeout, while `-1` represents a system's default value.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.connectTimeout)
*/
public var connectTimeout: Int = 10_000

/**
* Specifies a time period (in milliseconds) in which a client should start a request.
*
* A `0` value represents an infinite timeout, while `-1` represents a system's default value.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.connectionRequestTimeout)
*/
public var connectionRequestTimeout: Int = 20_000

/**
* Allows you to configure [SSL](https://ktor.io/docs/client-ssl.html) settings for this engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.sslContext)
*/
public var sslContext: SSLContext? = null

/**
* Specifies a custom processor for [RequestConfig.Builder].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.customRequest)
*/
public var customRequest: (RequestConfig.Builder.() -> RequestConfig.Builder) = { this }
private set

/**
* Specifies a custom processor for [HttpAsyncClientBuilder].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.customClient)
*/
public var customClient: (HttpAsyncClientBuilder.() -> HttpAsyncClientBuilder) = { this }
private set

/**
* Customizes a [RequestConfig.Builder] in the specified [block].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.customizeRequest)
*/
public fun customizeRequest(block: RequestConfig.Builder.() -> Unit) {
val current = customRequest
Expand All @@ -69,6 +87,8 @@ public class ApacheEngineConfig : HttpClientEngineConfig() {

/**
* Customizes a [HttpAsyncClientBuilder] in the specified [block].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.customizeClient)
*/
public fun customizeClient(block: HttpAsyncClientBuilder.() -> Unit) {
val current = customClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import io.ktor.client.engine.*
* ```
*
* You can learn more about client engines from [Engines](https://ktor.io/docs/http-client-engines.html).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5)
*/
public data object Apache5 : HttpClientEngineFactory<Apache5EngineConfig> {
override fun create(block: Apache5EngineConfig.() -> Unit): HttpClientEngine {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,51 @@ import javax.net.ssl.SSLContext

/**
* A configuration for the [Apache5] client engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig)
*/
public class Apache5EngineConfig : HttpClientEngineConfig() {
/**
* Specifies whether to follow redirects automatically.
* Disabled by default.
*
* _Note: By default, the Apache client allows `50` redirects._
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.followRedirects)
*/
public var followRedirects: Boolean = false

/**
* Specifies a maximum time (in milliseconds) of inactivity between two data packets when exchanging data with a server.
*
* Set this value to `0` to use an infinite timeout.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.socketTimeout)
*/
public var socketTimeout: Int = 10_000

/**
* Specifies a time period (in milliseconds) in which a client should establish a connection with a server.
*
* A `0` value represents an infinite timeout, while `-1` represents a system's default value.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.connectTimeout)
*/
public var connectTimeout: Long = 10_000

/**
* Specifies a time period (in milliseconds) in which a client should start a request.
*
* A `0` value represents an infinite timeout, while `-1` represents a system's default value.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.connectionRequestTimeout)
*/
public var connectionRequestTimeout: Long = 20_000

/**
* Allows you to configure [SSL](https://ktor.io/docs/client-ssl.html) settings for this engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.sslContext)
*/
public var sslContext: SSLContext? = null

Expand All @@ -59,6 +71,9 @@ public class Apache5EngineConfig : HttpClientEngineConfig() {
* Default value is [HostnameVerificationPolicy.BOTH] which provides maximum security
* by performing verification at both stages.
*
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.sslHostnameVerificationPolicy)
*
* @see HostnameVerificationPolicy
*/
public var sslHostnameVerificationPolicy: HostnameVerificationPolicy = HostnameVerificationPolicy.BOTH
Expand All @@ -69,6 +84,8 @@ public class Apache5EngineConfig : HttpClientEngineConfig() {

/**
* Customizes a [RequestConfig.Builder] in the specified [block].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.customizeRequest)
*/
public fun customizeRequest(block: RequestConfig.Builder.() -> Unit) {
val current = customRequest
Expand All @@ -77,6 +94,8 @@ public class Apache5EngineConfig : HttpClientEngineConfig() {

/**
* Customizes a [HttpAsyncClientBuilder] in the specified [block].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.customizeClient)
*/
public fun customizeClient(block: HttpAsyncClientBuilder.() -> Unit) {
val current = customClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import io.ktor.client.engine.*
* ```
*
* You can learn more about client engines from [Engines](https://ktor.io/docs/http-client-engines.html).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.CIO)
*/
public data object CIO : HttpClientEngineFactory<CIOEngineConfig> {
override fun create(block: CIOEngineConfig.() -> Unit): HttpClientEngine =
Expand Down
Loading

0 comments on commit 4c710ae

Please sign in to comment.