Last active
June 22, 2020 09:57
-
-
Save romainbsl/ff3b903754e44e0d35bd416206c65afc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Auth API | |
| interface AuthApi { | |
| suspend fun authenticate(pid: Int, deviceId: String): Token | |
| } | |
| class AuthApiImpl : ClientApi(), AuthApi { | |
| override suspend fun authenticate(pid: Int, deviceId: String)= | |
| client.get<Token> { / * implementation */ } | |
| } | |
| // Token repository | |
| interface TokenRepository { | |
| fun isLoggedIn(): Boolean | |
| fun putToken(token: Token): Key<Token> | |
| } | |
| class TokenRepositoryImpl(private val db: DB) : TokenRepository { | |
| override fun isLoggedIn(): Boolean { /* implementation */ } | |
| override fun putToken(token: Token): Key<Token> { /* implementation */ } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment