File tree Expand file tree Collapse file tree 11 files changed +64
-43
lines changed
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code Expand file tree Collapse file tree 11 files changed +64
-43
lines changed Original file line number Diff line number Diff line change 1- // swift-tools-version:5.8
1+ // swift-tools-version:6.0
22// The swift-tools-version declares the minimum version of Swift required to build this package.
33
44import PackageDescription
Original file line number Diff line number Diff line change 1- // swift-tools-version:5.8
1+ // swift-tools-version:6.0
22// The swift-tools-version declares the minimum version of Swift required to build this package.
33
44import PackageDescription
55
66let package = Package (
77 name: " SquareNumberLambda " ,
88 platforms: [
9- . macOS( . v12 )
9+ . macOS( . v15 )
1010 ]
1111)
Original file line number Diff line number Diff line change 1- // swift-tools-version:5.8
1+ // swift-tools-version:6.0
22// The swift-tools-version declares the minimum version of Swift required to build this package.
33
44import PackageDescription
55
66let package = Package (
77 name: " SquareNumberLambda " ,
88 platforms: [
9- . macOS( . v12 )
9+ . macOS( . v15 )
1010 ] ,
1111 dependencies: [
12- . package ( url: " https://github.com/swift-server/swift-aws-lambda-runtime.git " , from: " 1.0.0-alpha " )
12+ . package ( url: " https://github.com/swift-server/swift-aws-lambda-runtime.git " , from: " main " )
1313 ]
1414)
Original file line number Diff line number Diff line change 1- // swift-tools-version:5.8
1+ // swift-tools-version:6.0
22// The swift-tools-version declares the minimum version of Swift required to build this package.
33
44import PackageDescription
55
66let package = Package (
77 name: " SquareNumberLambda " ,
88 platforms: [
9- . macOS( . v12 )
9+ . macOS( . v15 )
1010 ] ,
1111 products: [
1212 . executable( name: " SquareNumberLambda " , targets: [ " SquareNumberLambda " ] )
1313 ] ,
1414 dependencies: [
15- . package ( url: " https://github.com/swift-server/swift-aws-lambda-runtime.git " , from: " 1.0.0-alpha " )
15+ . package ( url: " https://github.com/swift-server/swift-aws-lambda-runtime.git " , from: " main " )
1616 ]
1717)
Original file line number Diff line number Diff line change 1- // swift-tools-version:5.8
1+ // swift-tools-version:6.0
22// The swift-tools-version declares the minimum version of Swift required to build this package.
33
44import PackageDescription
55
66let package = Package (
77 name: " SquareNumberLambda " ,
88 platforms: [
9- . macOS( . v12 )
9+ . macOS( . v15 )
1010 ] ,
1111 products: [
1212 . executable( name: " SquareNumberLambda " , targets: [ " SquareNumberLambda " ] )
1313 ] ,
1414 dependencies: [
15- . package ( url: " https://github.com/swift-server/swift-aws-lambda-runtime.git " , from: " 1.0.0-alpha " )
15+ . package ( url: " https://github.com/swift-server/swift-aws-lambda-runtime.git " , from: " main " )
1616 ] ,
1717 targets: [
1818 . executableTarget(
Original file line number Diff line number Diff line change 1- @main
2- struct SquareNumberHandler : SimpleLambdaHandler { }
1+ // the data structure to represent the input parameter
2+ struct Request : Decodable {
3+ let number : Double
4+ }
Original file line number Diff line number Diff line change 1- import AWSLambdaRuntime
1+ // the data structure to represent the input parameter
2+ struct Request : Decodable {
3+ let number : Double
4+ }
25
3- @main
4- struct SquareNumberHandler : SimpleLambdaHandler { }
6+ // the data structure to represent the output response
7+ struct Response : Encodable {
8+ let result : Double
9+ }
Original file line number Diff line number Diff line change 11import AWSLambdaRuntime
22
3- @ main
4- struct SquareNumberHandler : SimpleLambdaHandler {
5- func handle ( _ event : Event , context : LambdaContext ) async throws -> Output { }
3+ // the data structure to represent the input parameter
4+ struct Request : Decodable {
5+ let number : Double
66}
7+
8+ // the data structure to represent the output response
9+ struct Response : Encodable {
10+ let result : Double
11+ }
12+
13+ // the Lambda runtime
14+ let runtime = LambdaRuntime {
Original file line number Diff line number Diff line change 11import AWSLambdaRuntime
22
3- struct Input : Codable {
3+ // the data structure to represent the input parameter
4+ struct Request : Decodable {
45 let number : Double
56}
67
7- struct Number : Codable {
8+ // the data structure to represent the output response
9+ struct Response : Encodable {
810 let result : Double
911}
1012
11- @main
12- struct SquareNumberHandler : SimpleLambdaHandler {
13- func handle( _ event: Event , context: LambdaContext ) async throws -> Output { }
14- }
13+ // the Lambda runtime
14+ let runtime = LambdaRuntime {
15+ ( event: Request , context: LambdaContext ) in
16+
17+ }
Original file line number Diff line number Diff line change 11import AWSLambdaRuntime
22
3- struct Input : Codable {
3+ // the data structure to represent the input parameter
4+ struct Request : Decodable {
45 let number : Double
56}
67
7- struct Number : Codable {
8+ // the data structure to represent the output response
9+ struct Response : Encodable {
810 let result : Double
911}
1012
11- @main
12- struct SquareNumberHandler : SimpleLambdaHandler {
13- typealias Event = Input
14- typealias Output = Number
13+ // the Lambda runtime
14+ let runtime = LambdaRuntime {
15+ ( event: Request , context: LambdaContext ) in
1516
16- func handle ( _ event: Event , context : LambdaContext ) async throws -> Output { }
17- }
17+ Response ( result : event. number * event . number )
18+ }
You can’t perform that action at this time.
0 commit comments