StabilityAiCreditsRepositoryImpl

Implements StabilityAiCreditsRepository behavior in the SDAI data layer.

Author

Dmitriy Moroz

Constructors

Link copied to clipboard
constructor(remoteDataSource: StabilityAiCreditsRemoteDataSource, localDataSource: StabilityAiCreditsDataSource.Local, preferenceManager: PreferenceManager)

Properties

Link copied to clipboard

Exposes the localDataSource value used by the SDAI data layer.

Link copied to clipboard

Exposes the preferenceManager value used by the SDAI data layer.

Link copied to clipboard

Exposes the remoteDataSource value used by the SDAI data layer.

Functions

Link copied to clipboard
private fun <T> checkServerSource(onValid: () -> T, onNotValid: () -> T): T

Executes the checkServerSource step in the SDAI data layer.

Link copied to clipboard
private suspend fun <T> checkServerSourceSuspend(onValid: suspend () -> T, onNotValid: () -> T): T

Executes the checkServerSourceSuspend step in the SDAI data layer.

Link copied to clipboard
open suspend override fun fetch()

Loads SDAI data through fetch.

Link copied to clipboard
open suspend override fun fetchAndGet(): Float

Loads SDAI data through fetchAndGet.

Link copied to clipboard
open override fun fetchAndObserve(): Flow<Float>

Loads SDAI data through fetchAndObserve.

Link copied to clipboard
open suspend override fun get(): Float

Loads SDAI data through get.

Link copied to clipboard

Executes the isStabilityAiSource step in the SDAI data layer.

Link copied to clipboard
open override fun observe(): Flow<Float>

Loads SDAI data through observe.

Link copied to clipboard

Executes the wrongServerSourceSelected step in the SDAI data layer.