{"id":22117715,"url":"https://github.com/prosumma/kodi","last_synced_at":"2025-03-24T06:14:38.131Z","repository":{"id":85504713,"uuid":"403770130","full_name":"Prosumma/KoDI","owner":"Prosumma","description":"Kotlin Dependency Injection","archived":false,"fork":false,"pushed_at":"2022-01-18T03:31:12.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-29T11:46:16.723Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Prosumma.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-06T22:10:19.000Z","updated_at":"2021-11-14T00:25:54.000Z","dependencies_parsed_at":"2023-03-07T14:15:14.791Z","dependency_job_id":null,"html_url":"https://github.com/Prosumma/KoDI","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prosumma%2FKoDI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prosumma%2FKoDI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prosumma%2FKoDI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prosumma%2FKoDI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Prosumma","download_url":"https://codeload.github.com/Prosumma/KoDI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217936,"owners_count":20579300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T13:38:46.613Z","updated_at":"2025-03-24T06:14:38.123Z","avatar_url":"https://github.com/Prosumma.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KoDI\n\nKoDI is a tiny dependency injection library written in Kotlin. (It's also not the first Kotlin DI library to be called \"KoDI\".) \n\nIt's primarily intended as an exercise in learning Kotlin. I have no plans to promote its use, though I may use it for some of my own projects. Its goals are to be very simple, extensible, and pleasant to use.\n\nThe unit tests and source documentation will tell you most of what you need to know about using it.\n\n## Examples\n\n```kotlin\ninterface Plugin\nclass MyPlugin: Plugin\nclass YourPlugin: Plugin\n\nclass PluginAssembly: Assembly {\n  override fun register(registrar: Registar) {\n    val group = \"plugins\"  \n    registrar.apply { \n      singleton\u003cPlugin\u003e(tag = \"my\", group = \"plugins\") { MyPlugin() }\n      singleton\u003cPlugin\u003e(tag = \"your\", group = \"plugins\") { YourPlugin() }\n    }\n  }\n}\n\ninterface CoolService\nclass ConcreteCoolService(val target: String): CoolService\n\nclass CoreAssembly: Assembly {\n  override val assemblies: List\u003cAssembly\u003e\n    get() = listOf(PluginAssembly())\n\n  override fun register(registrar: Registrar) {\n    registrar.singleton\u003cCoolService\u003e(params(::ConcreteCoolService))\n  }\n}\n\nfun main() {\n  DI.assemble(CoreAssembly())\n  // Resolve all plugins, regardless of tag, in the plugins group\n  val plugins: List\u003cPlugin\u003e = DI.resolveAll\u003cPlugin\u003e(group = \"plugins\")\n  // Resolve a particular plugin\n  val plugin: Plugin = DI.resolve(tag = \"my\", group = \"plugins\")\n  // Resolve a service with parameter\n  val coolService: CoolService = DI.resolve(\"cool\") \n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprosumma%2Fkodi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprosumma%2Fkodi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprosumma%2Fkodi/lists"}