ServerConfigDataSource

internal class ServerConfigDataSource(dao: <Error class: unknown class>, versionApi: <Error class: unknown class>, serverConfigMapper: ServerConfigMapper = MapperProvider.serverConfigMapper(), dispatchers: <Error class: unknown class> = KaliumDispatcherImpl) : ServerConfigRepository

Constructors

Link copied to clipboard
constructor(dao: <Error class: unknown class>, versionApi: <Error class: unknown class>, serverConfigMapper: ServerConfigMapper = MapperProvider.serverConfigMapper(), dispatchers: <Error class: unknown class> = KaliumDispatcherImpl)

Functions

Link copied to clipboard
open suspend override fun configForUser(userId: <Error class: unknown class>): Either<StorageFailure, ServerConfig>

Return the server links and metadata for the given userId

Link copied to clipboard

calculate the app/server common api version for a new non stored config and store it locally if the version is valid can return a ServerConfigFailure in case of an invalid version

Link copied to clipboard
open suspend override fun getOrFetchMetadata(serverLinks: ServerConfig.Links): Either<CoreFailure, ServerConfig>
Link copied to clipboard
Link copied to clipboard
open suspend override fun updateConfigApiVersion(serverConfig: ServerConfig): Either<CoreFailure, Unit>

update the api version of a locally stored config