net.bjoernpetersen.musicbot.api.config.ConfigManager.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of musicbot Show documentation
Show all versions of musicbot Show documentation
Core library of MusicBot, which plays music from various providers.
package net.bjoernpetersen.musicbot.api.config
import net.bjoernpetersen.musicbot.spi.config.ConfigStorageAdapter
class ConfigManager(
private val plainStorageAdapter: ConfigStorageAdapter,
private val secretStorageAdapter: ConfigStorageAdapter,
private val stateStorageAdapter: ConfigStorageAdapter) {
private val configs: MutableMap = HashMap()
operator fun get(scope: ConfigScope): Configs = configs.computeIfAbsent(scope) {
Configs(
plain = Config(plainStorageAdapter, it),
secrets = Config(secretStorageAdapter, it),
state = Config(stateStorageAdapter, it)
)
}
}
data class Configs(
val plain: Config,
val secrets: Config,
val state: Config)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy