Skip to content

Commit 3401b76

Browse files
author
Sebastien Stormacq
committed
fix swift-format
1 parent 3985358 commit 3401b76

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Examples/MultiSourceAPI/Sources/main.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,41 +31,41 @@ struct MultiSourceHandler: StreamingLambdaHandler {
3131
) async throws {
3232
let decoder = JSONDecoder()
3333
let data = Data(event.readableBytesView)
34-
34+
3535
// Try to decode as ALBTargetGroupRequest first
3636
if let albRequest = try? decoder.decode(ALBTargetGroupRequest.self, from: data) {
3737
context.logger.info("Received ALB request to path: \(albRequest.path)")
38-
38+
3939
let response = ALBTargetGroupResponse(
4040
statusCode: .ok,
4141
headers: ["Content-Type": "application/json"],
4242
body: "{\"source\":\"ALB\",\"path\":\"\(albRequest.path)\"}"
4343
)
44-
44+
4545
let encoder = JSONEncoder()
4646
let responseData = try encoder.encode(response)
4747
try await responseWriter.write(ByteBuffer(bytes: responseData))
4848
try await responseWriter.finish()
4949
return
5050
}
51-
51+
5252
// Try to decode as APIGatewayV2Request
5353
if let apiGwRequest = try? decoder.decode(APIGatewayV2Request.self, from: data) {
5454
context.logger.info("Received API Gateway V2 request to path: \(apiGwRequest.rawPath)")
55-
55+
5656
let response = APIGatewayV2Response(
5757
statusCode: .ok,
5858
headers: ["Content-Type": "application/json"],
5959
body: "{\"source\":\"APIGatewayV2\",\"path\":\"\(apiGwRequest.rawPath)\"}"
6060
)
61-
61+
6262
let encoder = JSONEncoder()
6363
let responseData = try encoder.encode(response)
6464
try await responseWriter.write(ByteBuffer(bytes: responseData))
6565
try await responseWriter.finish()
6666
return
6767
}
68-
68+
6969
// Unknown event type
7070
context.logger.error("Unable to decode event as ALB or API Gateway V2 request")
7171
throw LambdaError.invalidEvent

0 commit comments

Comments
 (0)