-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhancement] Communications library for non Apple platforms (#15)
This PR contains the work done to allow the `MakeURLRequestUseCase` use case to be used in non-Apple platforms, as it use has been restricted before. To provide further details about the work done: - [x] improved the `MakeURLRequestUseCase` use case to be available in non-Apple platforms; - [x] moved the `TestEndpoint` helper endpoint to its own file; - [x] moved some test cases files around; - [x] updated some text in the `README` file. Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Reviewed-on: https://repo.rock-n-code.com/rock-n-code/swift-libs/pulls/15
- Loading branch information
Showing
6 changed files
with
53 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the SwiftLibs open source project | ||
// | ||
// Copyright (c) 2023 Röck+Cöde VoF. and the SwiftLibs project authors | ||
// Licensed under the EUPL 1.2 or later. | ||
// | ||
// See LICENSE.txt for license information | ||
// See CONTRIBUTORS.txt for the list of SwiftLibs project authors | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
import Communications | ||
import Foundation | ||
|
||
struct TestEndpoint: Endpoint { | ||
|
||
// MARK: Properties | ||
|
||
let scheme: String = "http" | ||
let host: String = "www.something.com" | ||
let port: Int? | ||
let path: String = "/path/to/endpoint" | ||
let parameters: Parameters | ||
let method: HTTPRequestMethod = .get | ||
let headers: Headers | ||
let body: Data? | ||
|
||
// MARK: Initialisers | ||
|
||
init( | ||
port: Int? = nil, | ||
parameters: Parameters = [:], | ||
headers: Headers = [:], | ||
body: Data? = nil | ||
) { | ||
self.port = port | ||
self.parameters = parameters | ||
self.headers = headers | ||
self.body = body | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.