Skip to content

Commit

Permalink
Merge pull request #112 from anti-social/add-lambda-for-plugin-config
Browse files Browse the repository at this point in the history
Add lambda
  • Loading branch information
UsenkoArtem authored Oct 17, 2024
2 parents cec06f1 + c82061c commit ab6e9ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Libs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object Versions {
const val grgit = "4.1.1"
const val detekt = "1.22.0"
const val dokka = "1.7.20"
const val mkdocs = "3.0.0"
const val mkdocs = "4.0.1"
// With 0.13.0 ':integ-tests:transformJvmTestAtomicfu' task somehow fails
const val binaryCompatibilityValidator = "0.12.1"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
public final class dev/evo/elasticmagic/transport/ElasticsearchKtorTransport : dev/evo/elasticmagic/transport/ElasticsearchTransport {
public fun <init> (Ljava/lang/String;Lio/ktor/client/engine/HttpClientEngine;Lkotlin/jvm/functions/Function1;)V
public synthetic fun <init> (Ljava/lang/String;Lio/ktor/client/engine/HttpClientEngine;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Ljava/lang/String;Lio/ktor/client/engine/HttpClientEngine;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
public synthetic fun <init> (Ljava/lang/String;Lio/ktor/client/engine/HttpClientEngine;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.evo.elasticmagic.transport

import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.engine.HttpClientEngine
import io.ktor.client.plugins.auth.Auth
import io.ktor.client.plugins.auth.providers.basic
Expand All @@ -21,6 +22,7 @@ import io.ktor.http.takeFrom
class ElasticsearchKtorTransport(
baseUrl: String,
engine: HttpClientEngine,
private val customHttpClientConfig: HttpClientConfig<*>.() -> Unit = {},
configure: Config.() -> Unit = {},
) : ElasticsearchTransport(
baseUrl,
Expand All @@ -29,6 +31,8 @@ class ElasticsearchKtorTransport(
private val client = HttpClient(engine) {
expectSuccess = false

customHttpClientConfig(this)

// Enable compressed response from Elasticsearch
if (config.gzipRequests) {
install(ContentEncoding) {
Expand Down

0 comments on commit ab6e9ee

Please sign in to comment.