You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/AWSLambdaRuntime/Lambda+Codable.swift
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -43,8 +43,8 @@ public struct LambdaJSONOutputEncoder<Output: Encodable>: LambdaOutputEncoder {
43
43
extensionLambdaCodableAdapter{
44
44
/// Initializes an instance given an encoder, decoder, and a handler with a non-`Void` output.
45
45
/// - Parameters:
46
-
/// - encoder: The encoder object that will be used to encode the generic ``Output`` obtained from the `handler`'s `outputWriter` into a ``ByteBuffer``.
47
-
/// - decoder: The decoder object that will be used to decode the received ``ByteBuffer`` event into the generic ``Event`` type served to the `handler`.
46
+
/// - encoder: The encoder object that will be used to encode the generic `Output` obtained from the `handler`'s `outputWriter` into a `ByteBuffer`.
47
+
/// - decoder: The decoder object that will be used to decode the received `ByteBuffer` event into the generic `Event` type served to the `handler`.
/// Initialize an instance with a ``LambdaHandler`` defined in the form of a closure **with a non-`Void` return type**.
69
+
/// Initialize an instance with a `LambdaHandler` defined in the form of a closure **with a non-`Void` return type**.
70
70
/// - Parameter body: The handler in the form of a closure.
71
-
/// - Parameter encoder: The encoder object that will be used to encode the generic ``Output`` into a ``ByteBuffer``. ``JSONEncoder()`` used as default.
72
-
/// - Parameter decoder: The decoder object that will be used to decode the incoming ``ByteBuffer`` event into the generic ``Event`` type. ``JSONDecoder()`` used as default.
71
+
/// - Parameter encoder: The encoder object that will be used to encode the generic `Output` into a `ByteBuffer`. `JSONEncoder()` used as default.
72
+
/// - Parameter decoder: The decoder object that will be used to decode the incoming `ByteBuffer` event into the generic `Event` type. `JSONDecoder()` used as default.
/// Initialize an instance with a ``LambdaHandler`` defined in the form of a closure **with a `Void` return type**.
96
+
/// Initialize an instance with a `LambdaHandler` defined in the form of a closure **with a `Void` return type**.
97
97
/// - Parameter body: The handler in the form of a closure.
98
-
/// - Parameter decoder: The decoder object that will be used to decode the incoming ``ByteBuffer`` event into the generic ``Event`` type. ``JSONDecoder()`` used as default.
98
+
/// - Parameter decoder: The decoder object that will be used to decode the incoming `ByteBuffer` event into the generic `Event` type. `JSONDecoder()` used as default.
Copy file name to clipboardExpand all lines: Sources/AWSLambdaRuntimeCore/Lambda+Codable.swift
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@
15
15
import NIOCore
16
16
17
17
/// The protocol a decoder must conform to so that it can be used with ``LambdaCodableAdapter`` to decode incoming
18
-
/// ``ByteBuffer`` events.
18
+
/// `ByteBuffer` events.
19
19
publicprotocolLambdaEventDecoder{
20
-
/// Decode the ``ByteBuffer`` representing the received event into the generic ``Event`` type
20
+
/// Decode the `ByteBuffer` representing the received event into the generic `Event` type
21
21
/// the handler will receive.
22
22
/// - Parameters:
23
23
/// - type: The type of the object to decode the buffer into.
@@ -27,14 +27,14 @@ public protocol LambdaEventDecoder {
27
27
}
28
28
29
29
/// The protocol an encoder must conform to so that it can be used with ``LambdaCodableAdapter`` to encode the generic
30
-
/// ``Output`` object into a ``ByteBuffer``.
30
+
/// ``LambdaOutputEncoder/Output`` object into a `ByteBuffer`.
31
31
publicprotocolLambdaOutputEncoder{
32
32
associatedtypeOutput
33
33
34
-
/// Encode the generic type `Output` the handler has returned into a ``ByteBuffer``.
34
+
/// Encode the generic type `Output` the handler has returned into a `ByteBuffer`.
35
35
/// - Parameters:
36
-
/// - value: The object to encode into a ``ByteBuffer``.
37
-
/// - buffer: The ``ByteBuffer`` where the encoded value will be written to.
36
+
/// - value: The object to encode into a `ByteBuffer`.
37
+
/// - buffer: The `ByteBuffer` where the encoded value will be written to.
38
38
func encode(_ value:Output, into buffer:inoutByteBuffer)throws
39
39
}
40
40
@@ -62,7 +62,7 @@ public struct LambdaHandlerAdapter<
62
62
self.handler = handler
63
63
}
64
64
65
-
/// Passes the generic ``Event`` object to the ``LambdaHandler/handle(_:context:)`` function, and
65
+
/// Passes the generic `Event` object to the ``LambdaHandler/handle(_:context:)`` function, and
66
66
/// the resulting output is then written to ``LambdaWithBackgroundProcessingHandler``'s `outputWriter`.
67
67
/// - Parameters:
68
68
/// - event: The received event.
@@ -93,9 +93,9 @@ public struct LambdaCodableAdapter<
93
93
@usableFromInlinevarbyteBuffer:ByteBuffer=.init()
94
94
95
95
/// Initializes an instance given an encoder, decoder, and a handler with a non-`Void` output.
96
-
/// - Parameters:
97
-
/// - encoder: The encoder object that will be used to encode the generic ``Output`` obtained from the `handler`'s `outputWriter` into a ``ByteBuffer``.
98
-
/// - decoder: The decoder object that will be used to decode the received ``ByteBuffer`` event into the generic ``Event`` type served to the `handler`.
96
+
/// - Parameters:
97
+
/// - encoder: The encoder object that will be used to encode the generic `Output` obtained from the `handler`'s `outputWriter` into a `ByteBuffer`.
98
+
/// - decoder: The decoder object that will be used to decode the received `ByteBuffer` event into the generic `Event` type served to the `handler`.
@@ -106,8 +106,8 @@ public struct LambdaCodableAdapter<
106
106
107
107
/// Initializes an instance given a decoder, and a handler with a `Void` output.
108
108
/// - Parameters:
109
-
/// - decoder: The decoder object that will be used to decode the received ``ByteBuffer`` event into the generic ``Event`` type served to the `handler`.
110
-
/// - handler: The handler object.
109
+
/// - decoder: The decoder object that will be used to decode the received `ByteBuffer` event into the generic `Event` type served to the `handler`.
@@ -145,7 +145,7 @@ where Output == Encoder.Output {
145
145
146
146
/// Initializes an instance given an encoder and an underlying ``LambdaResponseStreamWriter``.
147
147
/// - Parameters:
148
-
/// - encoder: The encoder object that will be used to encode the generic ``Output`` into a ``ByteBuffer``, which will then be passed to `streamWriter`.
148
+
/// - encoder: The encoder object that will be used to encode the generic `Output` into a `ByteBuffer`, which will then be passed to `streamWriter`.
149
149
/// - streamWriter: The underlying ``LambdaResponseStreamWriter`` that will be wrapped.
/// The body of the request sent to Lambda will be decoded into this type for the handler to consume.
@@ -95,7 +96,7 @@ public protocol LambdaWithBackgroundProcessingHandler {
95
96
96
97
/// Implement the business logic of the Lambda function here.
97
98
/// - Parameters:
98
-
/// - event: The generic ``Event`` object representing the invocation's input data.
99
+
/// - event: The generic ``LambdaWithBackgroundProcessingHandler/Event`` object representing the invocation's input data.
99
100
/// - outputWriter: The writer to send the computed response to. A call to `outputWriter.write(_:)` will return the response to the AWS Lambda response endpoint.
100
101
/// Any background work can then be executed before returning.
101
102
/// - context: The ``LambdaContext`` containing the invocation's metadata.
@@ -111,7 +112,7 @@ public protocol LambdaWithBackgroundProcessingHandler {
111
112
/// have a return type and exit at that point. This allows for background work to be executed _after_ a response has been sent to the AWS Lambda response endpoint.
112
113
publicprotocolLambdaResponseWriter<Output>{
113
114
associatedtypeOutput
114
-
/// Sends the generic ``Output`` object (representing the computed result of the handler)
115
+
/// Sends the generic ``LambdaResponseWriter/Output`` object (representing the computed result of the handler)
115
116
/// to the AWS Lambda response endpoint.
116
117
/// This function simply serves as a mechanism to return the computed result from a handler function
117
118
/// without an explicit `return`.
@@ -131,18 +132,18 @@ public struct StreamingClosureHandler: StreamingLambdaHandler {
131
132
self.body = body
132
133
}
133
134
134
-
/// Calls the provided `self.body` closure with the ``ByteBuffer`` invocation event, the ``LambdaResponseStreamWriter``, and the ``LambdaContext``
135
+
/// Calls the provided `self.body` closure with the `ByteBuffer` invocation event, the ``LambdaResponseStreamWriter``, and the ``LambdaContext``
135
136
/// - Parameters:
136
137
/// - event: The invocation's input data.
137
138
/// - responseWriter: A ``LambdaResponseStreamWriter`` to write the invocation's response to.
138
-
/// If no response or error is written to `responseWriter` an error will be reported to the invoker.
139
+
/// If no response or error is written to `responseWriter` an error will be reported to the invoker.
139
140
/// - context: The ``LambdaContext`` containing the invocation's metadata.
0 commit comments