Skip to content

swift: update demos to use direct API#349

Merged
rebello95 merged 4 commits intomasterfrom
swift-example
Aug 20, 2019
Merged

swift: update demos to use direct API#349
rebello95 merged 4 commits intomasterfrom
swift-example

Conversation

@rebello95
Copy link
Copy Markdown
Contributor

@rebello95 rebello95 commented Aug 20, 2019

This is a working end-to-end iOS implementation using Envoy Mobile as a library!

Depends on #312 and #353.

Updates our Swift example app to use the Envoy Mobile direct interfaces rather than using URLSession and Envoy as a listener.

Note: For now, we are no longer showing the text response of the response body due to the fact that the underlying implementation is not yet complete for bodied requests (headers-only).

Signed-off-by: Michael Rebello me@michaelrebello.com

Simulator Screen Shot - TestDevice - 2019-08-20 at 13 57 44

Signed-off-by: Michael Rebello <me@michaelrebello.com>
buildbreaker
buildbreaker previously approved these changes Aug 20, 2019
rebello95 added a commit that referenced this pull request Aug 20, 2019
This PR ties together the upstream Objective-C/++ implementation with the Swift interfaces/bridging implementation. After this change, end-to-end calls from the native Swift library into the Envoy core should be supported.

- Implements the streaming and unary request methods
- Adds a simple `EnvoyStreamEmitter` which sends requests from Swift down into Objective-C
- Updates the header conversion functions and their tests to convert to the proper types (`[String: [String]]` versus `[String: String]`)
- Implements `ResponseHandler` as a class which provides a pass-through for setting Objective-C blocks directly from Swift for handling responses
- Adds a parser for status codes, as well as tests

#349 will use this interface with the Swift demo apps.

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com>
Copy link
Copy Markdown
Member

@junr03 junr03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Copy link
Copy Markdown
Contributor

@goaway goaway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@rebello95 rebello95 merged commit 1ba8309 into master Aug 20, 2019
@rebello95 rebello95 deleted the swift-example branch August 20, 2019 21:13
rebello95 added a commit that referenced this pull request Aug 23, 2019
Updates our Swift example app to use the Envoy Mobile direct interfaces rather than using `URLSession` and Envoy as a listener.

Similar change to #349 which updated the Swift example app.

Notes:
- Changed all Objective-C demo app sources to `.m`, as they don't contain C/++ and thus don't need to be `.mm`
- Had to make some unfortunate changes to `Client.swift` and move the extension function to be implemented directly by the `Envoy` class, since extensions aren't allowed on Swift protocols that are visible to Objective-C. This temporarily breaks the `ClientTests.swift` file (not being run on CI), and I will open a PR after this lands to refactor/fix as necessary

Signed-off-by: Michael Rebello <me@michaelrebello.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 28, 2022
This PR ties together the upstream Objective-C/++ implementation with the Swift interfaces/bridging implementation. After this change, end-to-end calls from the native Swift library into the Envoy core should be supported.

- Implements the streaming and unary request methods
- Adds a simple `EnvoyStreamEmitter` which sends requests from Swift down into Objective-C
- Updates the header conversion functions and their tests to convert to the proper types (`[String: [String]]` versus `[String: String]`)
- Implements `ResponseHandler` as a class which provides a pass-through for setting Objective-C blocks directly from Swift for handling responses
- Adds a parser for status codes, as well as tests

envoyproxy/envoy-mobile#349 will use this interface with the Swift demo apps.

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 28, 2022
Updates our Swift example app to use the Envoy Mobile direct interfaces rather than using `URLSession` and Envoy as a listener.

Similar change to envoyproxy/envoy-mobile#349 which updated the Swift example app.

Notes:
- Changed all Objective-C demo app sources to `.m`, as they don't contain C/++ and thus don't need to be `.mm`
- Had to make some unfortunate changes to `Client.swift` and move the extension function to be implemented directly by the `Envoy` class, since extensions aren't allowed on Swift protocols that are visible to Objective-C. This temporarily breaks the `ClientTests.swift` file (not being run on CI), and I will open a PR after this lands to refactor/fix as necessary

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 29, 2022
This PR ties together the upstream Objective-C/++ implementation with the Swift interfaces/bridging implementation. After this change, end-to-end calls from the native Swift library into the Envoy core should be supported.

- Implements the streaming and unary request methods
- Adds a simple `EnvoyStreamEmitter` which sends requests from Swift down into Objective-C
- Updates the header conversion functions and their tests to convert to the proper types (`[String: [String]]` versus `[String: String]`)
- Implements `ResponseHandler` as a class which provides a pass-through for setting Objective-C blocks directly from Swift for handling responses
- Adds a parser for status codes, as well as tests

envoyproxy/envoy-mobile#349 will use this interface with the Swift demo apps.

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 29, 2022
Updates our Swift example app to use the Envoy Mobile direct interfaces rather than using `URLSession` and Envoy as a listener.

Similar change to envoyproxy/envoy-mobile#349 which updated the Swift example app.

Notes:
- Changed all Objective-C demo app sources to `.m`, as they don't contain C/++ and thus don't need to be `.mm`
- Had to make some unfortunate changes to `Client.swift` and move the extension function to be implemented directly by the `Envoy` class, since extensions aren't allowed on Swift protocols that are visible to Objective-C. This temporarily breaks the `ClientTests.swift` file (not being run on CI), and I will open a PR after this lands to refactor/fix as necessary

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants