Files
swift-aws-lambda-runtime/Examples/Deployment/Sources/HelloWorld/HelloWorldHandler.swift
T
tomer doron e5b44962bd Prefix data structures with Lambda instead of namespacing them (#256)
motivation: consisten naming convention

changes:
* Lambda.InitializationContext -> LambdaInitializationContext
* Lambda.Runner -> LambdaRunner
* Lambda.Configuration -> LambdaConfiguration
* Lambda.RuntimeError -> LambdaRuntimeError
* adjust call sites, tests, and examples
2022-04-15 13:33:54 +02:00

31 lines
964 B
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftAWSLambdaRuntime open source project
//
// Copyright (c) 2020 Apple Inc. and the SwiftAWSLambdaRuntime project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import AWSLambdaRuntime
// introductory example, the obligatory "hello, world!"
@main
struct HelloWorldHandler: LambdaHandler {
typealias Event = String
typealias Output = String
init(context: LambdaInitializationContext) async throws {
// setup your resources that you want to reuse here.
}
func handle(_ event: String, context: LambdaContext) async throws -> String {
"hello, world"
}
}