{"id":13565801,"url":"https://github.com/jdiazcano/cfg4k","last_synced_at":"2025-04-03T23:30:36.095Z","repository":{"id":44884295,"uuid":"75337058","full_name":"jdiazcano/cfg4k","owner":"jdiazcano","description":"Flexible and easy to use config library written in kotlin","archived":false,"fork":false,"pushed_at":"2022-01-20T21:38:51.000Z","size":936,"stargazers_count":80,"open_issues_count":10,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-04T19:42:13.523Z","etag":null,"topics":["configuration","kotlin","loader"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdiazcano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-01T22:07:01.000Z","updated_at":"2024-01-30T19:28:21.000Z","dependencies_parsed_at":"2022-07-21T15:36:51.266Z","dependency_job_id":null,"html_url":"https://github.com/jdiazcano/cfg4k","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdiazcano%2Fcfg4k","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdiazcano%2Fcfg4k/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdiazcano%2Fcfg4k/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdiazcano%2Fcfg4k/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdiazcano","download_url":"https://codeload.github.com/jdiazcano/cfg4k/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097586,"owners_count":20883121,"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":["configuration","kotlin","loader"],"created_at":"2024-08-01T13:01:55.745Z","updated_at":"2025-04-03T23:30:35.067Z","avatar_url":"https://github.com/jdiazcano.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/jdiazcano/cfg4k.svg?branch=master)](https://travis-ci.org/jdiazcano/cfg4k) [![Coverage Status](https://coveralls.io/repos/github/jdiazcano/cfg4k/badge.svg?branch=master)](https://coveralls.io/github/jdiazcano/cfg4k?branch=master) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [ ![Download](https://api.bintray.com/packages/jdiazcano/cfg4k/cfg4k-core/images/download.svg) ](https://bintray.com/jdiazcano/cfg4k/)\n\n# News\nThis repository is (will) be archived as I can no longer maintain it! But @rocketraman has forked it and published to mavencentral: https://github.com/rocketraman/cfg4k please continue using his repo!\n\n# Overview \nCfg4k is a configuration library made for Kotlin in Kotlin!\n\nFeatures\n* Automatic reload\n* Interface binding\n* Ability to handle data classes automatically\n* All the complex types and generics are supported\n* Huge flexibility, custom sources\n* Easy to use\n* Bytebuddy provider will be able to compile your bindings at runtime (You will need to add the cfg4k-bytebuddy to your dependencies.)\n\nFor further information, use the [wiki](https://github.com/jdiazcano/cfg4k/wiki)\n\n# Quick start\n1. Add the Bintray repository: \n```groovy\nrepositories {\n    jcenter()\n}\n```\n\n2. Add the dependency for the module(s) that you are going to use\n```\ncompile 'com.jdiazcano.cfg4k:cfg4k-core:$VERSION'\n```\n\n```kotlin\nfun main(args: Array\u003cString\u003e) {\n    val source = ClassPathConfigSource(\"global.properties\")         // Create source\n    val loader = PropertyConfigLoader(source)                       // Create loader\n    val provider = ProxyConfigProvider(loader)                      // Create provider\n    val databaseConfig = provider.bind\u003cDatabaseConfig\u003e(\"database\")  // bind and use\n\n    println(\"Name: ${databaseConfig.name()}\")\n    println(\"Url: ${databaseConfig.url()}\")\n    println(\"Port: ${databaseConfig.port()}\")\n}\n\n/**\n * This interface defines a database configuration\n */\ninterface DatabaseConfig {\n    /**\n     * You can have javadocs inside your properties and this is really cool\n     */\n    fun url(): String\n    fun port(): Int\n    fun name(): String\n\n    // if you have an unused property you know it and you can delete it\n    val unused: String\n\n    @Deprecated(\"You can even deprecate properties!\")\n    fun deprecated(): Boolean\n    \n    val youCanuseValuesToo: String\n    val andNullables: Int?\n}\n```\n\n# Architeture overview\n\n![Lightbox](https://raw.githubusercontent.com/jdiazcano/cfg4k/master/cfg4k-schema.png)\n\n# License\nLicensed under the Apache License, Version 2.0. See LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdiazcano%2Fcfg4k","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdiazcano%2Fcfg4k","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdiazcano%2Fcfg4k/lists"}