mirror of
https://github.com/safishamsi/graphify.git
synced 2026-07-13 02:47:00 +00:00
81a43f028f
Java, C, C++, Ruby, C#, Kotlin, Scala, PHP via tree-sitter (13 total) benchmark.py measures BFS subgraph tokens vs corpus tokens 5 skill bug fixes (cohesion crash, dead step, missing MCP tool)
24 lines
588 B
Kotlin
24 lines
588 B
Kotlin
import kotlinx.coroutines.delay
|
|
import kotlin.math.max
|
|
|
|
data class Config(val baseUrl: String, val timeout: Int)
|
|
|
|
class HttpClient(private val config: Config) {
|
|
fun get(path: String): String {
|
|
return buildRequest("GET", path)
|
|
}
|
|
|
|
fun post(path: String, body: String): String {
|
|
return buildRequest("POST", path)
|
|
}
|
|
|
|
private fun buildRequest(method: String, path: String): String {
|
|
return "$method ${config.baseUrl}$path"
|
|
}
|
|
}
|
|
|
|
fun createClient(baseUrl: String): HttpClient {
|
|
val config = Config(baseUrl, 30)
|
|
return HttpClient(config)
|
|
}
|