com.lightningkite.lightningserver.pubsub.PubSubSettings.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of server-core Show documentation
Show all versions of server-core Show documentation
A set of tools to fill in/replace what Ktor is lacking in.
The newest version!
package com.lightningkite.lightningserver.pubsub
import com.lightningkite.lightningserver.settings.Pluggable
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class PubSubSettings(
val url: String = "local",
@SerialName("uri") val legacyUri: String? = null,
) : () -> PubSub {
companion object : Pluggable() {
init {
register("local") { LocalPubSub }
}
}
override fun invoke(): PubSub = parse((legacyUri ?: url).substringBefore("://"), this.copy(url = legacyUri ?: url))
}