
commonMain.NetworkResponse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of network-response-jvm Show documentation
Show all versions of network-response-jvm Show documentation
NetworkResponse multiplatform
The newest version!
package com.javiersc.resources.networkResponse
import io.ktor.http.Headers
import io.ktor.http.HttpStatusCode
/**
* Sealed class which cover usual use cases related which network responses
*/
public sealed class NetworkResponse {
public data class Success(
val data: NR,
val status: HttpStatusCode,
val headers: Headers,
) : NetworkResponse()
public data class Error(
val error: E,
val status: HttpStatusCode,
val headers: Headers,
) : NetworkResponse()
public data class UnknownError(val throwable: Throwable) : NetworkResponse()
public object RemoteNotAvailable : NetworkResponse()
public object InternetNotAvailable : NetworkResponse()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy