Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lambda #112

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading