Skip to content

Commit 6e91d71

Browse files
committed
Rename Lambda.Context to LambdaContext
1 parent afab510 commit 6e91d71

File tree

21 files changed

+223
-213
lines changed

21 files changed

+223
-213
lines changed

Examples/Benchmark/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct MyLambda: EventLoopLambdaHandler {
2424
typealias Event = String
2525
typealias Output = String
2626

27-
func handle(_ event: String, context: Lambda.Context) -> EventLoopFuture<String> {
27+
func handle(_ event: String, context: LambdaContext) -> EventLoopFuture<String> {
2828
context.eventLoop.makeSucceededFuture("hello, world!")
2929
}
3030
}

Examples/Deployment/Sources/Benchmark/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct BenchmarkHandler: EventLoopLambdaHandler {
2424
typealias Event = String
2525
typealias Output = String
2626

27-
func handle(_ event: String, context: Lambda.Context) -> EventLoopFuture<String> {
27+
func handle(_ event: String, context: LambdaContext) -> EventLoopFuture<String> {
2828
context.eventLoop.makeSucceededFuture("hello, world!")
2929
}
3030
}

Examples/Deployment/Sources/HelloWorld/HelloWorldHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct HelloWorldHandler: LambdaHandler {
2424
// setup your resources that you want to reuse here.
2525
}
2626

27-
func handle(_ event: String, context: Lambda.Context) async throws -> String {
27+
func handle(_ event: String, context: LambdaContext) async throws -> String {
2828
"hello, world"
2929
}
3030
}

Examples/Echo/Lambda.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct MyLambda: LambdaHandler {
2525
// setup your resources that you want to reuse for every invocation here.
2626
}
2727

28-
func handle(_ input: String, context: Lambda.Context) async throws -> String {
28+
func handle(_ input: String, context: LambdaContext) async throws -> String {
2929
// as an example, respond with the input's reversed
3030
String(input.reversed())
3131
}

Examples/ErrorHandling/Lambda.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct MyLambda: LambdaHandler {
2323

2424
init(context: Lambda.InitializationContext) async throws {}
2525

26-
func handle(_ request: Request, context: Lambda.Context) async throws -> Response {
26+
func handle(_ request: Request, context: LambdaContext) async throws -> Response {
2727
// switch over the error type "requested" by the request, and trigger such error accordingly
2828
switch request.error {
2929
// no error here!

Examples/Foundation/Lambda.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct MyLambda: LambdaHandler {
3535
self.calculator = ExchangeRatesCalculator()
3636
}
3737

38-
func handle(_ event: Request, context: Lambda.Context) async throws -> [Exchange] {
38+
func handle(_ event: Request, context: LambdaContext) async throws -> [Exchange] {
3939
try await withCheckedThrowingContinuation { continuation in
4040
self.calculator.run(logger: context.logger) { result in
4141
switch result {

Examples/JSON/Lambda.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct MyLambda: LambdaHandler {
3434
// setup your resources that you want to reuse for every invocation here.
3535
}
3636

37-
func handle(_ event: Request, context: Lambda.Context) async throws -> Response {
37+
func handle(_ event: Request, context: LambdaContext) async throws -> Response {
3838
// as an example, respond with the input event's reversed body
3939
Response(body: String(event.body.reversed()))
4040
}

Examples/LocalDebugging/MyLambda/Lambda.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct MyLambda: LambdaHandler {
2727
// setup your resources that you want to reuse for every invocation here.
2828
}
2929

30-
func handle(_ request: Request, context: Lambda.Context) async throws -> Response {
30+
func handle(_ request: Request, context: LambdaContext) async throws -> Response {
3131
// TODO: something useful
3232
Response(message: "Hello, \(request.name)!")
3333
}

Examples/Testing/Sources/Lambda.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct MyLambda: LambdaHandler {
2525
// setup your resources that you want to reuse for every invocation here.
2626
}
2727

28-
func handle(_ event: String, context: Lambda.Context) async throws -> String {
28+
func handle(_ event: String, context: LambdaContext) async throws -> String {
2929
// as an example, respond with the event's reversed body
3030
String(event.reversed())
3131
}

Sources/AWSLambdaRuntime/Context+Foundation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import AWSLambdaRuntimeCore
1616
import struct Foundation.Date
1717

18-
extension Lambda.Context {
18+
extension LambdaContext {
1919
var deadlineDate: Date {
2020
let secondsSinceEpoch = Double(Int64(bitPattern: self.deadline.rawValue)) / -1_000_000_000
2121
return Date(timeIntervalSince1970: secondsSinceEpoch)

0 commit comments

Comments
 (0)