Kotlin

The Kotlin SDK targets the antd daemon over REST or gRPC.

Install

dependencies {
    implementation("com.autonomi:antd-kotlin:0.1.0")
}

Until the package is published, use the project as a local dependency or composite build.

Connect to the daemon

import com.autonomi.sdk.*
import kotlinx.coroutines.runBlocking

fun main() = runBlocking {
    val client = AntdClient.createRest("http://localhost:8082")
    val status = client.health()
    println(status.network)
    client.close()
}

Store and retrieve data

Type mappings

Autonomi type
Kotlin type

HealthStatus

Kotlin data class

PutResult

Kotlin data class

Raw data

ByteArray

Error handling

Full API reference

For all available daemon endpoints, see the REST API.

Last updated