Skip to content

💉 Kotlin DSL for building Guice modules

License

Notifications You must be signed in to change notification settings

reifiedbeans/kava

Repository files navigation

Kava

maven central docs license: MIT

An easy-to-use Kotlin DSL for building modules with the Guice dependency injection framework.

import dev.reifiedbeans.kava.getInstance
import dev.reifiedbeans.kava.kava

data class Message(val content: String)

fun main() {
    val module = kava {
        provide(Message::class) { Message("Hello, world!") }
    }

    val message = module.injector.getInstance(Message::class)
    println(message.content)
}

For a more realistic example, take a look at the SimpleApplication example.

License

Licensed under the MIT License.

About

💉 Kotlin DSL for building Guice modules

Topics

Resources

License

Stars

Watchers

Forks

Languages