Skip to content

Commit

Permalink
feat(#43): rsocket transport
Browse files Browse the repository at this point in the history
* feat(#43): rsocket transport

* feat: `files` api

* refactor: `grpc-engine` removal

* feat: factory function for RSocket transport engine

* fix: build

* docs: removal of grpc-engine notes, adding `RSocketTimeMatesRequestsEngine`

* fix: run tests

* fix: names

* fix: workflow

* fix: websockets should be installed before rsocket

* refactor: move to `rsocket`

* fix: build, missing requests

* fix & userId in auth model
  • Loading branch information
y9vad9 authored Dec 19, 2023
1 parent 3b31c4d commit bcd2616
Show file tree
Hide file tree
Showing 153 changed files with 1,688 additions and 1,325 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Build and Publish
env:
TIMEMATES_SDK_VERSION: ${{ github.ref }}
TIMEMATES_SDK_VERSION: ${{ github.ref_name }}
TIMEMATES_SSH_DEPLOY_PATH: ${{ secrets.TIMEMATES_SSH_DEPLOY_PATH }}
TIMEMATES_SSH_HOST: ${{ secrets.TIMEMATES_SSH_HOST }}
TIMEMATES_SSH_PASSWORD: ${{ secrets.TIMEMATES_SSH_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
distribution: 'corretto'
java-version: '17'
cache: 'gradle'
- run: ./gradlew test --no-daemon
- run: ./gradlew build --no-daemon
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ platform and integrate its features into your own applications.
To demonstrate the usage of the SDK, consider the following example:

```kotlin
val engineBuilder = DefaultGrpcEngineBuilder()
val engine = GrpcTimeMatesRequestsEngine(engineBuilder)
val engine = RSocketTimeMatesRequestsEngine(
coroutineScope = Dispatchers.IO,
)
val emailAuth = AccountLoginApi(engineBuilder).email
val email = EmailAddress.create("[email protected]").getOrElse { return }

Expand All @@ -24,12 +25,6 @@ val authorizationResult = emailAuth.authorize(email)
// until we complete our registration
.map { (isNewAccount, authorization) -> ... }
```
> **Note** <br>
> For android use [AndroidGrpcEngineBuilder](/grpc-engine/android/src/main/kotlin/io/timemates/android/grpc/AndroidGrpcEngineBuilder.kt)
>```kotlin
> val engineBuilder = AndroidGrpcEngineBuilder(applicationContext)
>```
In the provided code snippet, the SDK utilizes the Kotlin Result API extensively.

It's important to note that the SDK's value objects, such as `EmailAddress`
Expand Down Expand Up @@ -77,9 +72,7 @@ repositories {

dependencies {
implementation("io.timemates:sdk:$version")
implementation("io.timemates:grpc-engine:$version")
// for android
implementation("io.timemates:grpc-engine-android:$version")
implementation("io.timemates:rsocket-engine:$version")
}
```

Expand Down
11 changes: 9 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
[versions]
kotlin = "1.8.21"
kotlin = "1.9.20-Beta"
kotlinx-coroutines = "1.6.4"
kotlinx-serialization = "1.4.1"
ktor = "2.0.1"
kafka = "3.3.1"
jupiter = "5.4.0"
exposed = "0.41.1"
kmongo = "4.8.0"
androidGradlePlugin = "8.2.0-alpha13"
androidGradlePlugin = "8.3.0-alpha05"
androidComposeVersion = "1.4.0-alpha02"
grpc = "1.3.0"
protobuf = "3.22.0"
protobuf-plugin = "0.9.2"
grpc-netty = "1.55.1"
android-target = "33"
android-min = "24"
rsproto = "0.3.2"

[libraries]
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
Expand Down Expand Up @@ -66,6 +67,11 @@ grpc-android = { module = "io.grpc:grpc-android", version.require = "1.56.1" }
protobuf-kotlin = { module = "com.google.protobuf:protobuf-kotlin", version.ref = "protobuf" }
protobuf-java = { module = "com.google.protobuf:protobuf-java", version.ref = "protobuf" }

rsocket-client = { module = "io.rsocket.kotlin:rsocket-ktor-client", version.require = "0.15.4" }

timemates-rsproto-client = { module = "io.timemates.rsproto:client-core", version.ref = "rsproto" }
timemates-rsproto-common = { module = "io.timemates.rsproto:common-core", version.ref = "rsproto" }

[plugins]
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
Expand All @@ -76,3 +82,4 @@ android-library = { id = "com.android.library", version.ref = "androidGradlePlug
android-application = { id = "com.android.library", version.ref = "androidGradlePlugin" }
google-protobuf = { id = "com.google.protobuf", version.ref = "protobuf-plugin" }
library-publish = { id = "publish-library", version.require = "SNAPSHOT" }
timemates-rsproto = { id = "io.timemates.rsproto", version.ref = "rsproto" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-rc-2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
48 changes: 0 additions & 48 deletions grpc-engine/android/build.gradle.kts

This file was deleted.

This file was deleted.

72 changes: 0 additions & 72 deletions grpc-engine/build.gradle.kts

This file was deleted.

Loading

0 comments on commit bcd2616

Please sign in to comment.