All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.eu.codlab.tcgmapper.AbstractLoader.kt Maven / Gradle / Ivy

The newest version!
package eu.codlab.tcgmapper

import kotlinx.serialization.KSerializer
import kotlinx.serialization.StringFormat

open class AbstractLoader(
    file: String,
    serializer: KSerializer,
    github: GithubConfiguration,
    fileResource: suspend () -> ByteArray,
) {
    private val loader: Loader = Loader(
        file,
        serializer,
        github,
        fileResource,
    )

    suspend fun loadFromGithub(tag: String = "main") = loader.loadFromGithub(tag)

    suspend fun loadFromResource() = loader.loadFromResource()

    fun to(values: T, encoder: StringFormat = Provider.json) = loader.to(values, encoder)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy