All Projects → Nohus → AutoKonfig

Nohus / AutoKonfig

Licence: Apache-2.0 license
Kotlin configuration library with batteries included

Programming Languages

kotlin
9241 projects
HTML
75241 projects

Projects that are alternatives of or similar to AutoKonfig

DazzleConf
Incredible configuration library
Stars: ✭ 34 (+112.5%)
Mutual labels:  hocon
awesome-json-next
A Collection of What's Next for Awesome JSON (JavaScript Object Notation) for Structured (Meta) Data in Text - JSON5, HJSON, HanSON, TJSON, SON, CSON, USON, JSONX/JSON11 & Many More
Stars: ✭ 50 (+212.5%)
Mutual labels:  hocon
Config
configuration library for JVM languages using HOCON files
Stars: ✭ 5,459 (+34018.75%)
Mutual labels:  hocon
hocon-js
Hocon parser for JavaScript and NodeJS
Stars: ✭ 33 (+106.25%)
Mutual labels:  hocon
intellij-hocon
Standalone HOCON plugin for IntelliJ IDEA
Stars: ✭ 24 (+50%)
Mutual labels:  hocon
dataconf
Simple dataclasses configuration management for Python with hocon/json/yaml/properties/env-vars/dict support.
Stars: ✭ 40 (+150%)
Mutual labels:  hocon
hocon
go implementation of lightbend's HOCON configuration library https://github.com/lightbend/config
Stars: ✭ 49 (+206.25%)
Mutual labels:  hocon
HOCON-CN-Translation
Unofficial Simplified Chinese translation of HOCON.md in lightbend/config
Stars: ✭ 59 (+268.75%)
Mutual labels:  hocon
sconfig
Scala configuration library supporting HOCON for Scala, Java, Scala.js, and Scala Native
Stars: ✭ 99 (+518.75%)
Mutual labels:  hocon

AutoKonfig

AutoKonfig

Kotlin configuration library with batteries included.

License Coverage Version

Website

https://autokonfig.nohus.dev/

Features overview

  • Support for JSON, HOCON and Java properties config files
  • Loading config files from resources and remote URLs
  • Reading configuration from system properties and environment variables
  • Parsing command-line parameters
  • Merging properties loaded from multiple sources
  • Automatically finding config files
  • Type-safe properties
  • Support for default and optional values
  • Many useful property types, including dates (2020-02-02), times (10:15:30), durations (20s) and memory sizes (256 MB)
  • Type-specific parsing, a value of 1 can be the string "1", the integer 1, or the boolean true depending on which type is asked for
  • Collection types
  • 100% unit test coverage

Quick start

Gradle

implementation "dev.nohus:AutoKonfig:1.1.0"

Maven

<dependency>
    <groupId>dev.nohus</groupId>
    <artifactId>AutoKonfig</artifactId>
    <version>1.1.0</version>
</dependency>

The artifacts are available on Maven Central.

Simple example

Create a config file:

app.conf

host = nohus.dev
port = 80

Create variables for your properties:

Main.kt

fun main() {
    val host by StringSetting()
    val port by IntSetting()
    println("Host: $host, port: $port")
}

That's it! AutoKonfig automatically loaded your config file, because it had a well-known name. It knew which properties to load based on the variable names, and it mapped them to types based on the specified StringSetting and IntSetting delegates.

To see more, continue reading on the website.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].