Skip to content

Commit

Permalink
Replace buf and connect with connectrpc.com
Browse files Browse the repository at this point in the history
  • Loading branch information
buildbreaker committed Aug 8, 2023
1 parent 2ec892f commit 0e1b342
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 36 deletions.
6 changes: 3 additions & 3 deletions Examples/ElizaCocoaPodsApp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

This example app imports the `Connect` library using CocoaPods,
and provides an interface for
[chatting with Eliza](https://connect.build/demo).
[chatting with Eliza](https://connectrpc.com/demo).

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

- [Connect](https://connect.build) + unary
- [Connect](https://connect.build) + streaming
- [Connect](https://connectrpc.com) + unary
- [Connect](https://connectrpc.com) + streaming
- [gRPC-Web](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md) + unary
- [gRPC-Web](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md) + streaming

Expand Down
2 changes: 1 addition & 1 deletion Examples/ElizaSharedSources/AppSources/MenuView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct MenuView: View {
private func createClient(withProtocol networkProtocol: NetworkProtocol)
-> Buf_Connect_Demo_Eliza_V1_ElizaServiceClient
{
let host = "https://demo.connect.build"
let host = "https://demo.connectrpc.com"
#if COCOAPODS
let protocolClient = ProtocolClient(
httpClient: URLSessionHTTPClient(),
Expand Down
6 changes: 3 additions & 3 deletions Examples/ElizaSwiftPackageApp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

This example app imports the `Connect` library using Swift Package Manager,
and provides an interface for
[chatting with Eliza](https://buf.build/bufbuild/eliza).
[chatting with Eliza](https://connectrpc.com/bufbuild/eliza).

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

- [Connect](https://connect.build) + unary
- [Connect](https://connect.build) + streaming
- [Connect](https://connectrpc.com) + unary
- [Connect](https://connectrpc.com) + streaming
- [gRPC](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md) + unary (using `ConnectGRPC` + `SwiftNIO`)
- [gRPC](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md) + streaming (using `ConnectGRPC` + `SwiftNIO`)
- [gRPC-Web](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md) + unary
Expand Down
2 changes: 1 addition & 1 deletion Examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ each supported protocol using either unary or streaming APIs:
**Swift Package Manager**.
- [`ElizaCocoaPodsApp`](./ElizaCocoaPodsApp): Uses **CocoaPods**.

[eliza-demo]: https://connect.build/demo
[eliza-demo]: https://connectrpc.com/demo
6 changes: 3 additions & 3 deletions Libraries/Connect/Implementation/Codecs/Envelope.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public enum Envelope {
/// Computes the length of the message contained by a packed chunk of data.
/// A packed chunk in this context refers to prefixed message data.
///
/// Compliant with Connect streams: https://connect.build/docs/protocol/#streaming-request
/// Compliant with Connect streams: https://connectrpc.com/docs/protocol/#streaming-request
/// And gRPC: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#responses
///
/// - parameter data: The packed data from which to determine the enveloped message's size.
Expand All @@ -52,7 +52,7 @@ public enum Envelope {
/// Packs a message into an "envelope", adding required header bytes and optionally
/// applying compression.
///
/// Compliant with Connect streams: https://connect.build/docs/protocol/#streaming-request
/// Compliant with Connect streams: https://connectrpc.com/docs/protocol/#streaming-request
/// And gRPC: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests
///
/// - parameter source: The input message data.
Expand Down Expand Up @@ -83,7 +83,7 @@ public enum Envelope {
///
/// **Expects a fully framed envelope, not a partial message.**
///
/// Compliant with Connect streams: https://connect.build/docs/protocol/#streaming-response
/// Compliant with Connect streams: https://connectrpc.com/docs/protocol/#streaming-response
/// And gRPC: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#responses
///
/// - parameter source: The full envelope's data (header bytes + message bytes).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import Foundation

/// Implementation of the Connect protocol as an interceptor.
/// https://connect.build/docs/protocol
/// https://connectrpc.com/docs/protocol
struct ConnectInterceptor {
private let config: ProtocolClientConfig

Expand Down Expand Up @@ -138,7 +138,7 @@ extension ConnectInterceptor: Interceptor {
let isEndStream = 0b00000010 & headerByte != 0
if isEndStream {
// Expect a valid Connect end stream response, which can simply be {}.
// https://connect.build/docs/protocol#error-end-stream
// https://connectrpc.com/docs/protocol#error-end-stream
let response = try JSONDecoder().decode(
ConnectEndStreamResponse.self, from: message
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Foundation

/// Configuration used to set up `ProtocolClientInterface` implementations.
public struct ProtocolClientConfig {
/// Target host (e.g., `https://buf.build`).
/// Target host (e.g., `https://connectrpc.com`).
public let host: String
/// Protocol to use for requests and streams.
public let networkProtocol: NetworkProtocol
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Connect/Interfaces/Code.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public enum Code: Int, CaseIterable, Equatable, Sendable {
}

public static func fromHTTPStatus(_ status: Int) -> Self {
// https://connect.build/docs/protocol#http-to-error-code
// https://connectrpc.com/docs/protocol#http-to-error-code
switch status {
case 200:
return .ok
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

/// Structure modeling the final JSON message that is returned by Connect streams:
/// https://connect.build/docs/protocol#error-end-stream
/// https://connectrpc.com/docs/protocol#error-end-stream
struct ConnectEndStreamResponse: Sendable {
/// Connect error that was returned with the response.
let error: ConnectError?
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Connect/Interfaces/HTTPResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Foundation
/// Unary HTTP response received from the server.
public struct HTTPResponse: Sendable {
/// The status code of the response.
/// See https://connect.build/docs/protocol/#error-codes for more info.
/// See https://connectrpc.com/docs/protocol/#error-codes for more info.
public let code: Code
/// Response headers specified by the server.
public let headers: Headers
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Connect/Interfaces/NetworkProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/// Protocols that are supported by the library.
public enum NetworkProtocol {
/// The Connect protocol:
/// https://connect.build/docs/protocol
/// https://connectrpc.com/docs/protocol
case connect
/// The gRPC-Web protocol:
/// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This module contains support for the Connect and gRPC-Web protocols.
For gRPC support, you must also include the `ConnectNIO` module.

For additional details and tutorials, see the
[Connect-Swift documentation](https://connect.build/docs/swift/getting-started/).
[Connect-Swift documentation](https://connectrpc.com/docs/swift/getting-started/).
4 changes: 2 additions & 2 deletions Libraries/ConnectNIO/Public/NIOHTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ open class NIOHTTPClient: Connect.HTTPClientInterface {

/// Designated initializer for the client.
///
/// - parameter host: Target host (e.g., `https://buf.build`).
/// - parameter host: Target host (e.g., `https://connectrpc.com`).
/// - parameter port: Port to use for the connection. A default is provided based on whether a
/// secure connection is being established to the host via HTTPS. If this
/// parameter is omitted and the `host` parameter includes a port
/// (e.g., `https://buf.build:8080`), the host's port will be used.
/// (e.g., `https://connectrpc.com:8080`), the host's port will be used.
/// - parameter timeout: Optional timeout after which to terminate requests/streams if no
/// activity has occurred in the request or response path.
public init(host: String, port: Int? = nil, timeout: TimeInterval? = nil) {
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ a working SwiftUI chat app that uses Connect-Swift!
Comprehensive documentation for everything, including
[interceptors][interceptors], [mocking/testing][testing],
[streaming][streaming], and [error handling][error-handling]
is available on the [connect.build website][getting-started].
is available on the [connectrpc.com website][getting-started].

## Example Apps

Expand Down Expand Up @@ -174,15 +174,15 @@ Offered under the [Apache 2 license](./LICENSE).
[connect-crosstest]: https://github.com/bufbuild/connect-crosstest
[connect-go]: https://github.com/bufbuild/connect-go
[connect-kotlin]: https://github.com/bufbuild/connect-kotlin
[connect-protocol]: https://connect.build/docs/protocol
[connect-protocol]: https://connectrpc.com/docs/protocol
[connect-web]: https://www.npmjs.com/package/@bufbuild/connect-web
[error-handling]: https://connect.build/docs/swift/errors
[getting-started]: https://connect.build/docs/swift/getting-started
[error-handling]: https://connectrpc.com/docs/swift/errors
[getting-started]: https://connectrpc.com/docs/swift/getting-started
[grpc-protocol]: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
[grpc-web-protocol]: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md
[interceptors]: https://connect.build/docs/swift/interceptors
[interceptors]: https://connectrpc.com/docs/swift/interceptors
[protobuf]: https://developers.google.com/protocol-buffers
[slack]: https://buf.build/links/slack
[streaming]: https://connect.build/docs/swift/using-clients#using-generated-clients
[swift-pm-integration]: https://connect.build/docs/swift/getting-started#add-the-connect-swift-package
[testing]: https://connect.build/docs/swift/testing
[streaming]: https://connectrpc.com/docs/swift/using-clients#using-generated-clients
[swift-pm-integration]: https://connectrpc.com/docs/swift/getting-started#add-the-connect-swift-package
[testing]: https://connectrpc.com/docs/swift/testing
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ final class ConnectErrorTests: XCTestCase {
// MARK: - Private

private func errorData(expectedDetails: [SwiftProtobuf.Message]) throws -> Data {
// Example error from https://connect.build/docs/protocol/#error-end-stream
// Example error from https://connectrpc.com/docs/protocol/#error-end-stream
let dictionary: [String: Any] = [
"code": "unavailable",
"message": "overloaded: back off and retry",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private struct MockStreamInterceptor: Interceptor {
}

final class InterceptorChainTests: XCTestCase {
private let config = ProtocolClientConfig(host: "https://buf.build")
private let config = ProtocolClientConfig(host: "https://connectrpc.com")

func testUnary() throws {
let aRequestExpectation = self.expectation(description: "Filter A called with request")
Expand Down Expand Up @@ -144,7 +144,7 @@ final class InterceptorChainTests: XCTestCase {
).unaryFunction()

let interceptedRequest = chain.requestFunction(HTTPRequest(
url: try XCTUnwrap(URL(string: "https://buf.build/mock")),
url: try XCTUnwrap(URL(string: "https://connectrpc.com/mock")),
contentType: "application/json",
headers: Headers(),
message: nil,
Expand Down Expand Up @@ -214,7 +214,7 @@ final class InterceptorChainTests: XCTestCase {
).streamFunction()

let interceptedRequest = chain.requestFunction(HTTPRequest(
url: try XCTUnwrap(URL(string: "https://buf.build/mock")),
url: try XCTUnwrap(URL(string: "https://connectrpc.com/mock")),
contentType: "application/json",
headers: Headers(),
message: nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private struct NoopInterceptor: Interceptor {

final class ProtocolClientConfigTests: XCTestCase {
func testDefaultResponseCompressionPoolIncludesGzip() {
let config = ProtocolClientConfig(host: "https://buf.build")
let config = ProtocolClientConfig(host: "https://connectrpc.com")
XCTAssertTrue(config.responseCompressionPools[0] is GzipCompressionPool)
XCTAssertEqual(config.acceptCompressionPoolNames(), ["gzip"])
}
Expand All @@ -59,7 +59,7 @@ final class ProtocolClientConfigTests: XCTestCase {

func testAddsConnectInterceptorLastWhenUsingConnectProtocol() {
let config = ProtocolClientConfig(
host: "https://buf.build",
host: "https://connectrpc.com",
networkProtocol: .connect,
interceptors: [NoopInterceptor.init]
)
Expand All @@ -69,7 +69,7 @@ final class ProtocolClientConfigTests: XCTestCase {

func testAddsGRPCWebInterceptorLastWhenUsingGRPCWebProtocol() {
let config = ProtocolClientConfig(
host: "https://buf.build",
host: "https://connectrpc.com",
networkProtocol: .grpcWeb,
interceptors: [NoopInterceptor.init]
)
Expand Down

0 comments on commit 0e1b342

Please sign in to comment.