Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Replace buf and connect with connectrpc.com (#62)" #64

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ It only takes ~10 minutes to complete a working chat app that uses Connect-Kotli

Comprehensive documentation for everything, including
[interceptors][interceptors], [streaming][streaming], and [error handling][error-handling]
is available on the [connectrpc.com website][getting-started].
is available on the [connect.build website][getting-started].

## Generation Options
## Generation Options

| **Option** | **Type** | **Default** | **Repeatable** | **Details** |
|----------------------------|:--------:|:-----------:|:--------------:|-------------------------------------------------|
Expand All @@ -113,10 +113,10 @@ is available on the [connectrpc.com website][getting-started].

## Example Apps

Example apps are available in [`/examples`](./examples). First, run `make generate` to generate
Example apps are available in [`/examples`](./examples). First, run `make generate` to generate
code for the Protobuf plugins.

For the [Android example](./examples/android), you can run `make installandroid` to build and install
For the [Android example](./examples/android), you can run `make installandroid` to build and install
a fully functional Android application using Connect-Kotlin.

Additionally, there are pure Kotlin examples that demonstrate a simple main executable using Connect-Kotlin:
Expand Down Expand Up @@ -163,17 +163,17 @@ Offered under the [Apache 2 license][license].
[buf-studio]: https://buf.build/studio
[connect-crosstest]: https://github.com/bufbuild/connect-crosstest
[connect-go]: https://github.com/bufbuild/connect-go
[connect-protocol]: https://connectrpc.com/docs/protocol
[connect-protocol]: https://connect.build/docs/protocol
[connect-swift]: https://github.com/bufbuild/connect-swift
[connect-web]: https://www.npmjs.com/package/@bufbuild/connect-web
[error-handling]: https://connectrpc.com/docs/kotlin/errors
[getting-started]: https://connectrpc.com/docs/kotlin/getting-started
[error-handling]: https://connect.build/docs/kotlin/errors
[getting-started]: https://connect.build/docs/kotlin/getting-started
[grpc-protocol]: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
[grpc-web-protocol]: https://github.com/grpc/grpc-web
[interceptors]: https://connectrpc.com/docs/kotlin/interceptors
[interceptors]: https://connect.build/docs/kotlin/interceptors
[license]: https://github.com/bufbuild/connect-go/blob/main/LICENSE
[protobuf]: https://developers.google.com/protocol-buffers
[protocol]: https://connectrpc.com/docs/protocol
[protocol]: https://connect.build/docs/protocol
[server reflection]: https://github.com/bufbuild/connect-grpcreflect-go
[slack]: https://buf.build/links/slack
[streaming]: https://connectrpc.com/docs/kotlin/using-clients#using-generated-clients
[streaming]: https://connect.build/docs/kotlin/using-clients#using-generated-clients
6 changes: 3 additions & 3 deletions examples/android/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Eliza chat app example

This example app uses the `Connect` library and provides an interface for
[chatting with Eliza](https://connectrpc.com/bufbuild/eliza) via an Android application.
[chatting with Eliza](https://buf.build/bufbuild/eliza) via an Android application.

The app has support for chatting using a variety of protocols supported by
the Connect-Kotlin library:

- [Connect](https://connectrpc.com) + unary
- [Connect](https://connectrpc.com) + streaming
- [Connect](https://connect.build) + unary
- [Connect](https://connect.build) + streaming
- [gRPC](https://grpc.io) + unary
- [gRPC](https://grpc.io) + streaming
- [gRPC-Web](https://grpc.io) + unary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ElizaChatActivity : AppCompatActivity() {
.writeTimeout(10, TimeUnit.MINUTES)
.callTimeout(10, TimeUnit.MINUTES)
.build()
val host = "https://demo.connectrpc.com"
val host = "https://demo.connect.build"
val protocol = intent.getStringExtra(PROTOCOL_KEY)
// Get the user selected protocol.
val selectedNetworkProtocolOption = when (protocol) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Main {
@JvmStatic
fun main(args: Array<String>) {
runBlocking {
val host = "https://demo.connectrpc.com"
val host = "https://demo.connect.build"
val client = ProtocolClient(
httpClient = ConnectOkHttpClient(
OkHttpClient()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Main {
@JvmStatic
fun main(args: Array<String>) {
runBlocking {
val host = "https://demo.connectrpc.com"
val host = "https://demo.connect.build"
val client = ProtocolClient(
httpClient = ConnectOkHttpClient(
OkHttpClient()
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/kotlin/build/buf/connect/Code.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ enum class Code(val codeName: String, val value: Int) {
UNAUTHENTICATED("unauthenticated", 16);

companion object {
// https://connectrpc.com/docs/protocol#http-to-error-code
// https://connect.build/docs/protocol#http-to-error-code
fun fromHTTPStatus(status: Int): Code {
return when (status) {
200 -> OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import java.net.URI
* Set of configuration used to set up clients.
*/
class ProtocolClientConfig @JvmOverloads constructor(
// The host (e.g., https://connectrpc.com).
// The host (e.g., https://buf.build).
val host: String,
// The client to use for performing requests.
// The serialization strategy for decoding messages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import java.net.URL

/**
* The Connect protocol.
* https://connectrpc.com/docs
* https://connect.build/docs
*/
internal class ConnectInterceptor(
private val clientConfig: ProtocolClientConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class InterceptorChainTest {

@Test
fun fifo_request_unary() {
val response = unaryChain.requestFunction(HTTPRequest(URL("https://connectrpc.com"), "", emptyMap(), null, methodSpec))
val response = unaryChain.requestFunction(HTTPRequest(URL("https://buf.build"), "", emptyMap(), null, methodSpec))
assertThat(response.headers.get("id")).containsExactly("1", "2", "3", "4")
}

Expand All @@ -76,7 +76,7 @@ class InterceptorChainTest {

@Test
fun fifo_request_stream() {
val request = streamingChain.requestFunction(HTTPRequest(URL("https://connectrpc.com"), "", emptyMap(), null, methodSpec))
val request = streamingChain.requestFunction(HTTPRequest(URL("https://buf.build"), "", emptyMap(), null, methodSpec))
assertThat(request.headers.get("id")).containsExactly("1", "2", "3", "4")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ class ProtocolClientConfigTest {
@Test
fun hostUri() {
val config = ProtocolClientConfig(
host = "https://connectrpc.com",
host = "https://connect.build",
serializationStrategy = mock { }
)
assertThat(config.baseUri.host).isEqualTo("connectrpc.com")
assertThat(config.baseUri.host).isEqualTo("connect.build")
assertThat(config.baseUri.toURL()).isNotNull()
}

@Test(expected = MalformedURLException::class)
fun unsupportedSchemeErrorsWhenTranslatingToURL() {
val config = ProtocolClientConfig(
host = "xhtp://connectrpc.com",
host = "xhtp://connect.build",
serializationStrategy = mock { }
)
config.baseUri.toURL()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BiDirectionalStreamTest {
val client = ProtocolClient(
httpClient = mock { },
config = ProtocolClientConfig(
host = "https://connectrpc.com/",
host = "https://buf.build/",
serializationStrategy = serializationStrategy
)
)
Expand Down Expand Up @@ -72,7 +72,7 @@ class BiDirectionalStreamTest {
val client = ProtocolClient(
httpClient = mock { },
config = ProtocolClientConfig(
host = "https://connectrpc.com/",
host = "https://buf.build/",
serializationStrategy = serializationStrategy
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ProtocolClientTest {
val client = ProtocolClient(
httpClient = httpClient,
config = ProtocolClientConfig(
host = "https://connectrpc.com/",
host = "https://buf.build/",
serializationStrategy = serializationStrategy
)
)
Expand All @@ -70,7 +70,7 @@ class ProtocolClientTest {
val client = ProtocolClient(
httpClient = httpClient,
config = ProtocolClientConfig(
host = "https://connectrpc.com",
host = "https://buf.build",
serializationStrategy = serializationStrategy
)
)
Expand All @@ -94,7 +94,7 @@ class ProtocolClientTest {
val client = ProtocolClient(
httpClient = httpClient,
config = ProtocolClientConfig(
host = "https://connectrpc.com/",
host = "https://buf.build/",
serializationStrategy = serializationStrategy
)
)
Expand All @@ -119,7 +119,7 @@ class ProtocolClientTest {
val client = ProtocolClient(
httpClient = httpClient,
config = ProtocolClientConfig(
host = "https://connectrpc.com",
host = "https://buf.build",
serializationStrategy = serializationStrategy
)
)
Expand All @@ -143,7 +143,7 @@ class ProtocolClientTest {
val client = ProtocolClient(
httpClient = httpClient,
config = ProtocolClientConfig(
host = "https://connectrpc.com",
host = "https://buf.build",
serializationStrategy = serializationStrategy
)
)
Expand All @@ -160,7 +160,7 @@ class ProtocolClientTest {
// Use HTTP client to determine and verify the final URL.
val captor = argumentCaptor<HTTPRequest>()
verify(httpClient).unary(captor.capture(), any())
assertThat(captor.firstValue.url.toString()).isEqualTo("https://connectrpc.com/build.buf.connect.SomeService/Service")
assertThat(captor.firstValue.url.toString()).isEqualTo("https://buf.build/build.buf.connect.SomeService/Service")
}

@Test
Expand All @@ -171,7 +171,7 @@ class ProtocolClientTest {
val client = ProtocolClient(
httpClient = httpClient,
config = ProtocolClientConfig(
host = "https://connectrpc.com/",
host = "https://buf.build/",
serializationStrategy = serializationStrategy
)
)
Expand All @@ -188,6 +188,6 @@ class ProtocolClientTest {
// Use HTTP client to determine and verify the final URL.
val captor = argumentCaptor<HTTPRequest>()
verify(httpClient).unary(captor.capture(), any())
assertThat(captor.firstValue.url.toString()).isEqualTo("https://connectrpc.com/build.buf.connect.SomeService/Service")
assertThat(captor.firstValue.url.toString()).isEqualTo("https://buf.build/build.buf.connect.SomeService/Service")
}
}
Loading
Loading