-
I'm having trouble figuring out how to specify the type of val client = SttpJdkURLClientBuilder.load((os.home / ".kube" / "scratch-config.yaml").toNIO) shows this:
Using that type signature doesn't seem to work, though. This fails to compile: package blah
import scala.collection.mutable
import dev.hnaderi.k8s.circe.*
import dev.hnaderi.k8s.client.{APIs, HttpClient, SttpJdkURLClientBuilder}
import dev.hnaderi.k8s.client.SttpKBackend.SttpF
import sttp.client3.circe.*
import sttp.client3.*
object Clusters:
val clientCache: mutable.Map[String, HttpClient[[_] =>> SttpF[Identity, _]]] = mutable.Map()
def client(name: String): HttpClient[[_] =>> SttpF[Identity, _]] =
clientCache.getOrElseUpdate(name, SttpJdkURLClientBuilder.load((os.home / ".kube" / s"$name-config.yaml").toNIO))
def clusters(using options: Options) =
options.clusters.map(client(_)) with this error:
What should should I use for the type of Sttp instances? |
Beta Was this translation helpful? Give feedback.
Answered by
hnaderi
Dec 13, 2023
Replies: 2 comments
-
Hi @a01fe import sttp.client3.Response
// Other imports
val client: HttpClient[Response] = SttpJdkURLClientBuilder.defaultConfig |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hnaderi
-
That's way to easy! ty! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @a01fe
You can simply write
HttpClient[Response]
. For example: