├── conformance
├── client
│ ├── known-failing-stream-cases.txt
│ ├── known-failing-unary-cases.txt
│ ├── build.gradle.kts
│ ├── standard-unary-config.yaml
│ ├── lite-unary-config.yaml
│ ├── standard-stream-config.yaml
│ ├── lite-stream-config.yaml
│ ├── src
│ │ └── main
│ │ │ └── kotlin
│ │ │ └── com
│ │ │ └── connectrpc
│ │ │ └── conformance
│ │ │ └── client
│ │ │ └── adapt
│ │ │ ├── AnyMessage.kt
│ │ │ ├── Invoker.kt
│ │ │ ├── ClientResponseResult.kt
│ │ │ ├── ClientCompatResponse.kt
│ │ │ ├── UnaryClient.kt
│ │ │ ├── SuspendCloseable.kt
│ │ │ ├── ServerStreamClient.kt
│ │ │ ├── RequestStream.kt
│ │ │ └── ClientCompatRequest.kt
│ ├── google-javalite
│ │ ├── build.gradle.kts
│ │ └── src
│ │ │ └── main
│ │ │ └── kotlin
│ │ │ └── com
│ │ │ └── connectrpc
│ │ │ └── conformance
│ │ │ └── client
│ │ │ └── javalite
│ │ │ ├── JavaLiteBidiStreamClient.kt
│ │ │ ├── JavaLiteClientStreamClient.kt
│ │ │ ├── Main.kt
│ │ │ ├── JavaLiteUnaryClient.kt
│ │ │ ├── JavaLiteUnimplementedClient.kt
│ │ │ ├── JavaLiteInvoker.kt
│ │ │ ├── JavaLiteIdempotentUnaryClient.kt
│ │ │ └── JavaLiteServerStreamClient.kt
│ └── google-java
│ │ ├── src
│ │ └── main
│ │ │ └── kotlin
│ │ │ └── com
│ │ │ └── connectrpc
│ │ │ └── conformance
│ │ │ └── client
│ │ │ └── java
│ │ │ ├── JavaBidiStreamClient.kt
│ │ │ ├── JavaClientStreamClient.kt
│ │ │ ├── Main.kt
│ │ │ ├── JavaUnaryClient.kt
│ │ │ ├── JavaUnimplementedClient.kt
│ │ │ ├── JavaInvoker.kt
│ │ │ ├── JavaIdempotentUnaryClient.kt
│ │ │ └── JavaServerStreamClient.kt
│ │ └── build.gradle.kts
└── buf.gen.yaml
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── examples
├── android
│ ├── src
│ │ └── main
│ │ │ ├── res
│ │ │ ├── drawable-hdpi
│ │ │ │ └── buf_logo.png
│ │ │ ├── values
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── themes.xml
│ │ │ ├── layout
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── item.xml
│ │ │ │ └── activity_eliza_chat.xml
│ │ │ └── drawable
│ │ │ │ └── line.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── kotlin
│ │ │ └── com
│ │ │ └── connectrpc
│ │ │ └── examples
│ │ │ └── android
│ │ │ ├── MainActivity.kt
│ │ │ └── RecyclerView.kt
│ ├── README.md
│ └── build.gradle.kts
├── generated-google-javalite
│ └── build.gradle.kts
├── generated-google-java
│ └── build.gradle.kts
├── kotlin-google-java
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── connectrpc
│ │ └── examples
│ │ └── kotlin
│ │ └── Main.kt
├── kotlin-google-javalite
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── connectrpc
│ │ └── examples
│ │ └── kotlin
│ │ └── Main.kt
└── buf.gen.yaml
├── .github
├── CODE_OF_CONDUCT.md
├── pull_request_template.md
├── release.yml
├── dependabot.yml
├── workflows
│ ├── add-to-project.yaml
│ └── pr-title.yaml
└── CONTRIBUTING.md
├── SECURITY.md
├── .gitignore
├── buf.yaml
├── MAINTAINERS.md
├── protoc-gen-connect-kotlin
├── buf.gen.yaml
├── proto
│ ├── no_package.proto
│ └── buf
│ │ ├── deprecation
│ │ └── v1
│ │ │ ├── file_deprecated.proto
│ │ │ ├── method_deprecated.proto
│ │ │ └── service_deprecated.proto
│ │ ├── javamultiplefiles
│ │ ├── enabled
│ │ │ └── v1
│ │ │ │ ├── enabled.proto
│ │ │ │ ├── enabled_empty.proto
│ │ │ │ └── enabled_nested.proto
│ │ ├── disabled
│ │ │ └── v1
│ │ │ │ ├── disabled.proto
│ │ │ │ ├── disabled_empty.proto
│ │ │ │ └── disabled_nested.proto
│ │ └── unspecified
│ │ │ └── v1
│ │ │ ├── unspecified.proto
│ │ │ ├── unspecified_empty.proto
│ │ │ └── enabled_nested.proto
│ │ ├── evilcomments
│ │ └── v1
│ │ │ └── evilcomments.proto
│ │ └── editions
│ │ └── v1
│ │ └── editions.proto
├── src
│ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── connectrpc
│ │ └── protocgen
│ │ └── connect
│ │ ├── Main.kt
│ │ └── internal
│ │ ├── CodeGenerator.kt
│ │ └── Parameters.kt
└── build.gradle.kts
├── extensions
├── buf.gen.yaml
├── google-javalite
│ ├── build.gradle.kts
│ └── src
│ │ ├── main
│ │ └── kotlin
│ │ │ └── com
│ │ │ └── connectrpc
│ │ │ └── extensions
│ │ │ ├── JavaLiteErrorParser.kt
│ │ │ ├── GoogleJavaLiteProtobufStrategy.kt
│ │ │ └── GoogleLiteProtoAdapter.kt
│ │ └── test
│ │ └── kotlin
│ │ └── com
│ │ └── connectrpc
│ │ └── extensions
│ │ └── JavaLiteErrorParserTest.kt
└── google-java
│ ├── build.gradle.kts
│ └── src
│ ├── main
│ └── kotlin
│ │ └── com
│ │ └── connectrpc
│ │ └── extensions
│ │ ├── GoogleJavaJSONStrategy.kt
│ │ ├── GoogleJavaProtobufStrategy.kt
│ │ ├── JavaErrorParser.kt
│ │ ├── GoogleJavaProtoAdapter.kt
│ │ └── GoogleJavaJSONAdapter.kt
│ └── test
│ └── kotlin
│ └── com
│ └── connectrpc
│ └── extensions
│ └── JavaErrorParserTest.kt
├── gradle.properties
├── settings.gradle.kts
├── library
├── src
│ ├── main
│ │ └── kotlin
│ │ │ └── com
│ │ │ └── connectrpc
│ │ │ ├── protocols
│ │ │ ├── NetworkProtocol.kt
│ │ │ ├── ConnectConstants.kt
│ │ │ ├── GETConfiguration.kt
│ │ │ ├── ErrorJSONModels.kt
│ │ │ └── GRPCCompletion.kt
│ │ │ ├── http
│ │ │ ├── TracingInfo.kt
│ │ │ ├── HTTPClientInterface.kt
│ │ │ ├── HTTPResponse.kt
│ │ │ └── Timeout.kt
│ │ │ ├── AnyError.kt
│ │ │ ├── StreamType.kt
│ │ │ ├── UnaryBlockingCall.kt
│ │ │ ├── RequestCompression.kt
│ │ │ ├── ErrorDetailParser.kt
│ │ │ ├── SerializationStrategy.kt
│ │ │ ├── MethodSpec.kt
│ │ │ ├── ConnectErrorDetail.kt
│ │ │ ├── compression
│ │ │ ├── GzipCompressionPool.kt
│ │ │ └── CompressionPool.kt
│ │ │ ├── impl
│ │ │ ├── ServerOnlyStream.kt
│ │ │ ├── BidirectionalStream.kt
│ │ │ ├── UnaryCall.kt
│ │ │ └── ClientOnlyStream.kt
│ │ │ ├── Idempotency.kt
│ │ │ ├── Codec.kt
│ │ │ ├── StreamResult.kt
│ │ │ ├── Interceptor.kt
│ │ │ └── Code.kt
│ └── test
│ │ └── kotlin
│ │ └── com
│ │ └── connectrpc
│ │ ├── ProtocolClientConfigTest.kt
│ │ ├── ConnectExceptionTest.kt
│ │ ├── compression
│ │ └── GzipCompressionPoolTest.kt
│ │ └── protocols
│ │ └── EnvelopeTest.kt
└── build.gradle.kts
├── okhttp
└── build.gradle.kts
└── gradlew.bat
/conformance/client/known-failing-stream-cases.txt:
--------------------------------------------------------------------------------
1 | # Currently there are zero failing tests.
--------------------------------------------------------------------------------
/conformance/client/known-failing-unary-cases.txt:
--------------------------------------------------------------------------------
1 | # Currently there are zero failing tests.
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/connectrpc/connect-kotlin/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/examples/android/src/main/res/drawable-hdpi/buf_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/connectrpc/connect-kotlin/HEAD/examples/android/src/main/res/drawable-hdpi/buf_logo.png
--------------------------------------------------------------------------------
/examples/android/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #161EDE
4 |
5 |
--------------------------------------------------------------------------------
/.github/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | ## Community Code of Conduct
2 |
3 | Connect follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
4 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | Security Policy
2 | ===============
3 |
4 | This project follows the [Connect security policy and reporting
5 | process](https://connectrpc.com/docs/governance/security).
6 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/examples/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Eliza Connect App
4 | I feel good.
5 | Send
6 | Eliza
7 |
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /**/build/*
2 | !/**/proto/build/*
3 | !/**/src/**/build/*
4 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
5 | !gradle-wrapper.jar
6 | /local.properties
7 | /.gradle
8 | /.idea
9 | *.iml
10 | /.tmp
11 | # Cache of project
12 | /.gradletasknamecache
13 | # Ignore Gradle GUI config
14 | /gradle-app.setting
15 |
--------------------------------------------------------------------------------
/.github/release.yml:
--------------------------------------------------------------------------------
1 | changelog:
2 | exclude:
3 | labels:
4 | - ignore-for-release
5 | authors:
6 | - dependabot
7 | categories:
8 | - title: Enhancements
9 | labels:
10 | - enhancement
11 | - title: Bugfixes
12 | labels:
13 | - bug
14 | - title: Other changes
15 | labels:
16 | - "*"
17 |
--------------------------------------------------------------------------------
/buf.yaml:
--------------------------------------------------------------------------------
1 | version: v2
2 | modules:
3 | - path: protoc-gen-connect-kotlin/proto
4 | lint:
5 | use:
6 | - STANDARD
7 | except:
8 | - FIELD_NOT_REQUIRED
9 | - PACKAGE_NO_IMPORT_CYCLE
10 | ignore:
11 | - protoc-gen-connect-kotlin/proto/no_package.proto
12 | rpc_allow_same_request_response: true
13 | breaking:
14 | except:
15 | - EXTENSION_NO_DELETE
16 | - FIELD_SAME_DEFAULT
17 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "github-actions"
4 | directory: "/"
5 | schedule:
6 | interval: "weekly"
7 | - package-ecosystem: "gradle"
8 | directory: "/"
9 | schedule:
10 | interval: "weekly"
11 | groups:
12 | kotlin:
13 | patterns:
14 | - "org.jetbrains.kotlin:*"
15 | - "com.google.devtools.ksp"
16 |
--------------------------------------------------------------------------------
/MAINTAINERS.md:
--------------------------------------------------------------------------------
1 | Maintainers
2 | ===========
3 |
4 | ## Current
5 | * [Peter Edge](https://github.com/bufdev), [Buf](https://buf.build)
6 | * [Michael Rebello](https://github.com/rebello95), [Airbnb](https://airbnb.com)
7 | * [Philip Warren](https://github.com/pkwarren), [Buf](https://buf.build)
8 | * [Josh Humphries](https://github.com/jhump), [Buf](https://buf.build)
9 |
10 | ## Former
11 | * [Alan Chiu](https://github.com/buildbreaker)
12 |
--------------------------------------------------------------------------------
/protoc-gen-connect-kotlin/buf.gen.yaml:
--------------------------------------------------------------------------------
1 | version: v2
2 | clean: true
3 | plugins:
4 | - local: ./protoc-gen-connect-kotlin/build/install/protoc-gen-connect-kotlin/bin/protoc-gen-connect-kotlin
5 | out: build/generated/sources/bufgen
6 | opt:
7 | - generateCallbackMethods=true
8 | - generateCoroutineMethods=true
9 | - protoc_builtin: java
10 | protoc_path: .tmp/bin/protoc
11 | out: build/generated/sources/bufgen
12 |
--------------------------------------------------------------------------------
/examples/android/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/.github/workflows/add-to-project.yaml:
--------------------------------------------------------------------------------
1 | name: Add issues and PRs to project
2 |
3 | on:
4 | issues:
5 | types:
6 | - opened
7 | - reopened
8 | - transferred
9 | pull_request_target:
10 | types:
11 | - opened
12 | - reopened
13 | issue_comment:
14 | types:
15 | - created
16 |
17 | jobs:
18 | call-workflow-add-to-project:
19 | name: Call workflow to add issue to project
20 | uses: connectrpc/base-workflows/.github/workflows/add-to-project.yaml@main
21 | secrets: inherit
22 |
--------------------------------------------------------------------------------
/extensions/buf.gen.yaml:
--------------------------------------------------------------------------------
1 | version: v2
2 | managed:
3 | enabled: true
4 | override:
5 | - file_option: java_package_prefix
6 | value: "com.connectrpc"
7 | clean: true
8 | plugins:
9 | - protoc_builtin: java
10 | protoc_path: .tmp/bin/protoc
11 | out: google-java/build/generated/sources/bufgen
12 | - protoc_builtin: java
13 | protoc_path: .tmp/bin/protoc
14 | out: google-javalite/build/generated/sources/bufgen
15 | opt: lite
16 | inputs:
17 | - module: buf.build/googleapis/googleapis
18 | types:
19 | - google.rpc.Status
20 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | android.useAndroidX=true
2 | android.enableJetifier=true
3 | kotlin.code.style=official
4 | org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError
5 | org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
6 | # For gradle-maven-publish plugin: https://vanniktech.github.io/gradle-maven-publish-plugin/central/
7 | SONATYPE_CONNECT_TIMEOUT_SECONDS=300
8 | SONATYPE_CLOSE_TIMEOUT_SECONDS=900
9 | RELEASE_SIGNING_ENABLED=true
10 | skipAndroid=false
11 | android.nonTransitiveRClass=false
12 | android.nonFinalResIds=false
13 |
--------------------------------------------------------------------------------
/conformance/client/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | kotlin("jvm")
3 | }
4 |
5 | tasks {
6 | compileKotlin {
7 | compilerOptions {
8 | // Generated Kotlin code for protobuf uses OptIn annotation
9 | freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
10 | }
11 | }
12 | }
13 |
14 | dependencies {
15 | implementation(project(":okhttp"))
16 | implementation(libs.kotlin.coroutines.core)
17 | implementation(libs.protobuf.javalite)
18 | implementation(libs.okio.core)
19 | implementation(libs.okhttp.tls)
20 | }
21 |
--------------------------------------------------------------------------------
/examples/generated-google-javalite/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | kotlin("jvm")
3 | java
4 | }
5 |
6 | tasks {
7 | compileKotlin {
8 | compilerOptions {
9 | freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
10 | }
11 | }
12 | }
13 |
14 | sourceSets {
15 | main {
16 | java {
17 | srcDir("build/generated/sources/bufgen")
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | implementation(libs.protobuf.javalite)
24 | api(project(":extensions:google-javalite"))
25 |
26 | implementation(project(":okhttp"))
27 | }
28 |
--------------------------------------------------------------------------------
/examples/android/README.md:
--------------------------------------------------------------------------------
1 | # Eliza chat app example
2 |
3 | This example app uses the `Connect` library and provides an interface for
4 | [chatting with Eliza](https://buf.build/connectrpc/eliza) via an Android application.
5 |
6 | The app has support for chatting using a variety of protocols supported by
7 | the Connect-Kotlin library:
8 |
9 | - [Connect](https://connectrpc.com) + unary
10 | - [Connect](https://connectrpc.com) + streaming
11 | - [gRPC](https://grpc.io) + unary
12 | - [gRPC](https://grpc.io) + streaming
13 | - [gRPC-Web](https://grpc.io) + unary
14 | - [gRPC-Web](https://grpc.io) + streaming
15 |
--------------------------------------------------------------------------------
/examples/generated-google-java/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | kotlin("jvm")
3 | java
4 | }
5 |
6 | tasks {
7 | compileKotlin {
8 | compilerOptions {
9 | freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
10 | }
11 | }
12 | }
13 |
14 | sourceSets {
15 | main {
16 | java {
17 | srcDir("build/generated/sources/bufgen")
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | implementation(libs.protobuf.java)
24 | implementation(libs.protobuf.java.util)
25 | api(project(":extensions:google-java"))
26 |
27 | implementation(project(":okhttp"))
28 | }
29 |
--------------------------------------------------------------------------------
/examples/android/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/.github/workflows/pr-title.yaml:
--------------------------------------------------------------------------------
1 | name: Lint PR Title
2 | # Prevent writing to the repository using the CI token.
3 | # Ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions
4 | permissions:
5 | pull-requests: read
6 | on:
7 | pull_request:
8 | # By default, a workflow only runs when a pull_request's activity type is opened,
9 | # synchronize, or reopened. We explicity override here so that PR titles are
10 | # re-linted when the PR text content is edited.
11 | types:
12 | - opened
13 | - edited
14 | - reopened
15 | - synchronize
16 | jobs:
17 | lint:
18 | uses: bufbuild/base-workflows/.github/workflows/pr-title.yaml@main
19 |
--------------------------------------------------------------------------------
/examples/android/src/main/res/drawable/line.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
6 |
7 |
8 |
9 |
10 |
11 | -
12 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/kotlin-google-java/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | application
3 | kotlin("jvm")
4 | }
5 |
6 | application {
7 | mainClass.set("com.connectrpc.examples.kotlin.Main")
8 | }
9 |
10 | tasks {
11 | jar {
12 | manifest {
13 | attributes(mapOf("Main-Class" to application.mainClass.get()))
14 | }
15 | from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) {
16 | exclude("META-INF/**/*")
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation(project(":examples:generated-google-java"))
23 | implementation(project(":okhttp"))
24 | implementation(libs.okhttp.core)
25 | implementation(libs.kotlin.coroutines.core)
26 | }
27 |
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | rootProject.name = "connect-kotlin"
2 |
3 | include(":conformance:client")
4 | include(":conformance:client:google-java")
5 | include(":conformance:client:google-javalite")
6 | if (extra.has("skipAndroid") && extra.get("skipAndroid").toString().toBoolean()) {
7 | println("Skipping Android build (skipAndroid=true)")
8 | } else {
9 | include(":examples:android")
10 | }
11 | include(":examples:generated-google-java")
12 | include(":examples:generated-google-javalite")
13 | include(":examples:kotlin-google-java")
14 | include(":examples:kotlin-google-javalite")
15 | include(":extensions:google-java")
16 | include(":extensions:google-javalite")
17 | include(":library")
18 | include(":okhttp")
19 | include(":protoc-gen-connect-kotlin")
20 |
--------------------------------------------------------------------------------
/examples/kotlin-google-javalite/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | application
3 | kotlin("jvm")
4 | }
5 |
6 | application {
7 | mainClass.set("com.connectrpc.examples.kotlin.Main")
8 | }
9 |
10 | tasks {
11 | jar {
12 | manifest {
13 | attributes(mapOf("Main-Class" to application.mainClass.get()))
14 | }
15 | from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) {
16 | exclude("META-INF/**/*")
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation(project(":examples:generated-google-javalite"))
23 | implementation(project(":okhttp"))
24 | implementation(libs.okhttp.core)
25 | implementation(libs.kotlin.coroutines.core)
26 | }
27 |
--------------------------------------------------------------------------------
/conformance/client/standard-unary-config.yaml:
--------------------------------------------------------------------------------
1 | # This configures the features that this client
2 | # supports and that will be verified by the
3 | # conformance test suite.
4 | features:
5 | versions:
6 | - HTTP_VERSION_1
7 | - HTTP_VERSION_2
8 | protocols:
9 | - PROTOCOL_CONNECT
10 | - PROTOCOL_GRPC
11 | - PROTOCOL_GRPC_WEB
12 | codecs:
13 | - CODEC_PROTO
14 | - CODEC_JSON
15 | compressions:
16 | - COMPRESSION_IDENTITY
17 | - COMPRESSION_GZIP
18 | streamTypes:
19 | # This config file only runs unary RPC test cases,
20 | # so that we can run them all three ways: suspend,
21 | # callback, and blocking.
22 | - STREAM_TYPE_UNARY
23 | # TODO: get client certs working and uncomment this
24 | #supportsTlsClientCerts: true
25 | supportsMessageReceiveLimit: false
26 |
--------------------------------------------------------------------------------
/conformance/client/lite-unary-config.yaml:
--------------------------------------------------------------------------------
1 | # This configures the features that this client
2 | # supports and that will be verified by the
3 | # conformance test suite.
4 | features:
5 | versions:
6 | - HTTP_VERSION_1
7 | - HTTP_VERSION_2
8 | protocols:
9 | - PROTOCOL_CONNECT
10 | - PROTOCOL_GRPC
11 | - PROTOCOL_GRPC_WEB
12 | codecs:
13 | - CODEC_PROTO
14 | # Lite does not support JSON
15 | compressions:
16 | - COMPRESSION_IDENTITY
17 | - COMPRESSION_GZIP
18 | streamTypes:
19 | # This config file only runs unary RPC test cases,
20 | # so that we can run them all three ways: suspend,
21 | # callback, and blocking.
22 | - STREAM_TYPE_UNARY
23 | # TODO: get client certs working and uncomment this
24 | #supportsTlsClientCerts: true
25 | supportsMessageReceiveLimit: false
26 |
--------------------------------------------------------------------------------
/conformance/client/standard-stream-config.yaml:
--------------------------------------------------------------------------------
1 | # This configures the features that this client
2 | # supports and that will be verified by the
3 | # conformance test suite.
4 | features:
5 | versions:
6 | - HTTP_VERSION_1
7 | - HTTP_VERSION_2
8 | protocols:
9 | - PROTOCOL_CONNECT
10 | - PROTOCOL_GRPC
11 | - PROTOCOL_GRPC_WEB
12 | codecs:
13 | - CODEC_PROTO
14 | - CODEC_JSON
15 | compressions:
16 | - COMPRESSION_IDENTITY
17 | - COMPRESSION_GZIP
18 | streamTypes:
19 | # This config file only runs stream RPC test cases.
20 | - STREAM_TYPE_CLIENT_STREAM
21 | - STREAM_TYPE_SERVER_STREAM
22 | - STREAM_TYPE_HALF_DUPLEX_BIDI_STREAM
23 | - STREAM_TYPE_FULL_DUPLEX_BIDI_STREAM
24 | # TODO: get client certs working and uncomment this
25 | #supportsTlsClientCerts: true
26 | supportsMessageReceiveLimit: false
27 |
--------------------------------------------------------------------------------
/conformance/client/lite-stream-config.yaml:
--------------------------------------------------------------------------------
1 | # This configures the features that this client
2 | # supports and that will be verified by the
3 | # conformance test suite.
4 | features:
5 | versions:
6 | - HTTP_VERSION_1
7 | - HTTP_VERSION_2
8 | protocols:
9 | - PROTOCOL_CONNECT
10 | - PROTOCOL_GRPC
11 | - PROTOCOL_GRPC_WEB
12 | codecs:
13 | - CODEC_PROTO
14 | # Lite does not support JSON
15 | compressions:
16 | - COMPRESSION_IDENTITY
17 | - COMPRESSION_GZIP
18 | streamTypes:
19 | # This config file only runs stream RPC test cases.
20 | - STREAM_TYPE_CLIENT_STREAM
21 | - STREAM_TYPE_SERVER_STREAM
22 | - STREAM_TYPE_HALF_DUPLEX_BIDI_STREAM
23 | - STREAM_TYPE_FULL_DUPLEX_BIDI_STREAM
24 | # TODO: get client certs working and uncomment this
25 | #supportsTlsClientCerts: true
26 | supportsMessageReceiveLimit: false
27 |
--------------------------------------------------------------------------------
/library/src/main/kotlin/com/connectrpc/protocols/NetworkProtocol.kt:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package com.connectrpc.protocols
16 |
17 | /**
18 | * The supported protocols:
19 | * Connect, GRPC, and GRPC-Web.
20 | */
21 | enum class NetworkProtocol {
22 | CONNECT,
23 | GRPC,
24 | GRPC_WEB,
25 | }
26 |
--------------------------------------------------------------------------------
/protoc-gen-connect-kotlin/proto/no_package.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | message SayRequest {
18 | string sentence = 1;
19 | }
20 |
21 | message SayResponse {
22 | string sentence = 1;
23 | }
24 |
25 | service ElizaService {
26 | rpc Say(SayRequest) returns (SayResponse) {}
27 | }
28 |
--------------------------------------------------------------------------------
/library/src/main/kotlin/com/connectrpc/http/TracingInfo.kt:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package com.connectrpc.http
16 |
17 | /**
18 | * Tracing metadata for [HTTPClientInterface] and [com.connectrpc.Interceptor].
19 | */
20 | data class TracingInfo(
21 | // The underlying http status code
22 | val httpStatus: Int,
23 | )
24 |
--------------------------------------------------------------------------------
/examples/android/src/main/res/layout/item.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
18 |
24 |
25 |
--------------------------------------------------------------------------------
/protoc-gen-connect-kotlin/src/main/kotlin/com/connectrpc/protocgen/connect/Main.kt:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package com.connectrpc.protocgen.connect
16 |
17 | import com.connectrpc.protocgen.connect.internal.Plugin
18 |
19 | class Main {
20 | companion object {
21 | @JvmStatic
22 | fun main(args: Array) {
23 | Plugin.run(Generator())
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/library/src/main/kotlin/com/connectrpc/AnyError.kt:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package com.connectrpc
16 |
17 | import okio.ByteString
18 |
19 | /**
20 | * This is a protobuf-runtime-agnostic representation of google.protobuf.Any
21 | * messages, which are used to represent error details in gRPC.
22 | */
23 | class AnyError(
24 | val typeUrl: String,
25 | val value: ByteString = ByteString.EMPTY,
26 | )
27 |
--------------------------------------------------------------------------------
/protoc-gen-connect-kotlin/proto/buf/deprecation/v1/file_deprecated.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package buf.deprecation.v1;
18 |
19 | option deprecated = true;
20 |
21 | message DeprecatedByFileRequest {}
22 |
23 | message DeprecatedByFileResponse {}
24 |
25 | service FileDeprecatedService {
26 | rpc DeprecatedByFile(DeprecatedByFileRequest) returns (DeprecatedByFileResponse) {}
27 | }
28 |
--------------------------------------------------------------------------------
/protoc-gen-connect-kotlin/proto/buf/deprecation/v1/method_deprecated.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package buf.deprecation.v1;
18 |
19 | message DeprecatedMethodRequest {}
20 |
21 | message DeprecatedMethodResponse {}
22 |
23 | service MethodDeprecatedService {
24 | rpc DeprecatedMethod(DeprecatedMethodRequest) returns (DeprecatedMethodResponse) {
25 | option deprecated = true;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/protoc-gen-connect-kotlin/proto/buf/deprecation/v1/service_deprecated.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package buf.deprecation.v1;
18 |
19 | message DeprecatedByServiceRequest {}
20 |
21 | message DeprecatedByServiceResponse {}
22 |
23 | service ServiceDeprecatedService {
24 | option deprecated = true;
25 | rpc DeprecatedByService(DeprecatedByServiceRequest) returns (DeprecatedByServiceResponse) {}
26 | }
27 |
--------------------------------------------------------------------------------
/library/src/main/kotlin/com/connectrpc/StreamType.kt:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package com.connectrpc
16 |
17 | /**
18 | * Represents the RPC stream type. Set by the code generator on each [MethodSpec].
19 | */
20 | enum class StreamType {
21 | /** Unary RPC. */
22 | UNARY,
23 |
24 | /** Client streaming RPC. */
25 | CLIENT,
26 |
27 | /** Server streaming RPC. */
28 | SERVER,
29 |
30 | /** Bidirectional streaming RPC. */
31 | BIDI,
32 | }
33 |
--------------------------------------------------------------------------------
/protoc-gen-connect-kotlin/proto/buf/javamultiplefiles/enabled/v1/enabled.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package buf.javamultiplefiles.enabled.v1;
18 |
19 | option java_multiple_files = true;
20 |
21 | message EnabledRequest {
22 | string sentence = 1;
23 | }
24 |
25 | message EnabledResponse {
26 | string sentence = 1;
27 | }
28 |
29 | service EnabledService {
30 | rpc Enabled(EnabledRequest) returns (EnabledResponse) {}
31 | }
32 |
--------------------------------------------------------------------------------
/protoc-gen-connect-kotlin/proto/buf/javamultiplefiles/disabled/v1/disabled.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package buf.javamultiplefiles.disabled.v1;
18 |
19 | option java_multiple_files = false;
20 |
21 | message DisabledRequest {
22 | string sentence = 1;
23 | }
24 |
25 | message DisabledResponse {
26 | string sentence = 1;
27 | }
28 |
29 | service DisabledService {
30 | rpc Disabled(DisabledRequest) returns (DisabledResponse) {}
31 | }
32 |
--------------------------------------------------------------------------------
/examples/android/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.application")
3 | id("kotlin-android")
4 | }
5 |
6 | android {
7 | compileSdk = 35
8 |
9 | defaultConfig {
10 | applicationId = "com.connectrpc.examples.android"
11 | minSdk = 28
12 | targetSdk = 35
13 | versionCode = 1
14 | versionName = "1.0"
15 | multiDexEnabled = true
16 | }
17 |
18 | compileOptions {
19 | sourceCompatibility = JavaVersion.VERSION_1_8
20 | targetCompatibility = JavaVersion.VERSION_1_8
21 | }
22 | namespace = "com.connectrpc.examples.android"
23 | }
24 |
25 | dependencies {
26 | implementation(libs.androidx.appcompat)
27 | implementation(libs.androidx.constraintLayout)
28 | implementation(libs.androidx.recyclerview)
29 | implementation(libs.android.multidex)
30 | implementation(libs.androidx.lifecycle.runtime.ktx)
31 | implementation(libs.android.material)
32 |
33 | implementation(project(":okhttp"))
34 | implementation(project(":examples:generated-google-javalite"))
35 | implementation(libs.okhttp.core)
36 | }
37 |
--------------------------------------------------------------------------------
/examples/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
14 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/protoc-gen-connect-kotlin/proto/buf/javamultiplefiles/enabled/v1/enabled_empty.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package buf.javamultiplefiles.enabled.v1;
18 |
19 | option java_multiple_files = true;
20 |
21 | message EnabledEmpty {
22 | }
23 |
24 | message EnabledEmptyRPCRequest {
25 | }
26 |
27 | message EnabledEmptyRPCResponse {
28 | }
29 |
30 | service EnabledEmptyService {
31 | rpc EnabledEmptyRPC(EnabledEmptyRPCRequest) returns (EnabledEmptyRPCResponse);
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/protoc-gen-connect-kotlin/proto/buf/javamultiplefiles/disabled/v1/disabled_empty.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package buf.javamultiplefiles.disabled.v1;
18 |
19 | option java_multiple_files = false;
20 |
21 | message DisabledEmpty {
22 | }
23 |
24 | message DisabledEmptyRPCRequest {
25 | }
26 |
27 | message DisabledEmptyRPCResponse {
28 | }
29 |
30 | service DisabledEmptyService {
31 | rpc DisabledEmptyRPC(DisabledEmptyRPCRequest) returns (DisabledEmptyRPCResponse);
32 | }
33 |
--------------------------------------------------------------------------------
/examples/buf.gen.yaml:
--------------------------------------------------------------------------------
1 | version: v2
2 | managed:
3 | enabled: true
4 | override:
5 | - file_option: java_package_prefix
6 | value: "com"
7 | clean: true
8 | plugins:
9 | - local: ./protoc-gen-connect-kotlin/build/install/protoc-gen-connect-kotlin/bin/protoc-gen-connect-kotlin
10 | out: generated-google-java/build/generated/sources/bufgen
11 | - protoc_builtin: java
12 | protoc_path: .tmp/bin/protoc
13 | out: generated-google-java/build/generated/sources/bufgen
14 | - protoc_builtin: kotlin
15 | protoc_path: .tmp/bin/protoc
16 | out: generated-google-java/build/generated/sources/bufgen
17 | - local: ./protoc-gen-connect-kotlin/build/install/protoc-gen-connect-kotlin/bin/protoc-gen-connect-kotlin
18 | out: generated-google-javalite/build/generated/sources/bufgen
19 | - protoc_builtin: java
20 | protoc_path: .tmp/bin/protoc
21 | out: generated-google-javalite/build/generated/sources/bufgen
22 | opt: lite
23 | - protoc_builtin: kotlin
24 | protoc_path: .tmp/bin/protoc
25 | out: generated-google-javalite/build/generated/sources/bufgen
26 | opt: lite
27 | inputs:
28 | - module: buf.build/connectrpc/eliza
29 |
--------------------------------------------------------------------------------
/protoc-gen-connect-kotlin/proto/buf/javamultiplefiles/unspecified/v1/unspecified.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package buf.javamultiplefiles.unspecified.v1;
18 |
19 | // Avoid using this option.
20 | //option java_multiple_files = false;
21 |
22 | message UnspecifiedRequest {
23 | string sentence = 1;
24 | }
25 |
26 | message UnspecifiedResponse {
27 | string sentence = 1;
28 | }
29 |
30 | service UnspecifiedService {
31 | rpc Unspecified(UnspecifiedRequest) returns (UnspecifiedResponse) {}
32 | }
33 |
--------------------------------------------------------------------------------
/conformance/client/src/main/kotlin/com/connectrpc/conformance/client/adapt/AnyMessage.kt:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package com.connectrpc.conformance.client.adapt
16 |
17 | import com.google.protobuf.ByteString
18 |
19 | /**
20 | * Corresponds to a google.protobuf.Any message. This is distinct
21 | * from the com.google.protobuf.Any Java class so that it can be
22 | * used without relying on a particular runtime (e.g. the lite vs.
23 | * standard runtimes).
24 | */
25 | class AnyMessage(
26 | val typeUrl: String,
27 | val value: ByteString,
28 | )
29 |
--------------------------------------------------------------------------------
/library/src/main/kotlin/com/connectrpc/UnaryBlockingCall.kt:
--------------------------------------------------------------------------------
1 | // Copyright 2022-2025 The Connect Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package com.connectrpc
16 |
17 | /**
18 | * A [UnaryBlockingCall] contains the way to make a blocking RPC call and cancelling the RPC.
19 | */
20 | interface UnaryBlockingCall