Skip to content

Commit bb7fe7c

Browse files
committed
Make closure initializers and handler adapters public
1 parent c870b43 commit bb7fe7c

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

Sources/AWSLambdaRuntime/Lambda+Codable.swift

+6-7
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,16 @@ import class Foundation.JSONEncoder
2626

2727
extension JSONDecoder: AWSLambdaRuntimeCore.LambdaEventDecoder {}
2828

29-
@usableFromInline
30-
package struct LambdaJSONOutputEncoder<Output: Encodable>: LambdaOutputEncoder {
29+
public struct LambdaJSONOutputEncoder<Output: Encodable>: LambdaOutputEncoder {
3130
@usableFromInline let jsonEncoder: JSONEncoder
3231

3332
@inlinable
34-
package init(_ jsonEncoder: JSONEncoder) {
33+
public init(_ jsonEncoder: JSONEncoder) {
3534
self.jsonEncoder = jsonEncoder
3635
}
3736

3837
@inlinable
39-
package func encode(_ value: Output, into buffer: inout ByteBuffer) throws {
38+
public func encode(_ value: Output, into buffer: inout ByteBuffer) throws {
4039
try self.jsonEncoder.encode(value, into: &buffer)
4140
}
4241
}
@@ -47,7 +46,7 @@ extension LambdaCodableAdapter {
4746
/// - encoder: The encoder object that will be used to encode the generic ``Output`` obtained from the `handler`'s `outputWriter` into a ``ByteBuffer``.
4847
/// - decoder: The decoder object that will be used to decode the received ``ByteBuffer`` event into the generic ``Event`` type served to the `handler`.
4948
/// - handler: The handler object.
50-
package init(
49+
public init(
5150
encoder: JSONEncoder,
5251
decoder: JSONDecoder,
5352
handler: Handler
@@ -71,7 +70,7 @@ extension LambdaRuntime {
7170
/// - Parameter body: The handler in the form of a closure.
7271
/// - Parameter encoder: The encoder object that will be used to encode the generic ``Output`` into a ``ByteBuffer``. ``JSONEncoder()`` used as default.
7372
/// - Parameter decoder: The decoder object that will be used to decode the incoming ``ByteBuffer`` event into the generic ``Event`` type. ``JSONDecoder()`` used as default.
74-
package convenience init<Event: Decodable, Output>(
73+
public convenience init<Event: Decodable, Output>(
7574
body: @escaping (Event, LambdaContext) async throws -> Output,
7675
encoder: JSONEncoder = JSONEncoder(),
7776
decoder: JSONDecoder = JSONDecoder()
@@ -97,7 +96,7 @@ extension LambdaRuntime {
9796
/// Initialize an instance with a ``LambdaHandler`` defined in the form of a closure **with a `Void` return type**.
9897
/// - Parameter body: The handler in the form of a closure.
9998
/// - Parameter decoder: The decoder object that will be used to decode the incoming ``ByteBuffer`` event into the generic ``Event`` type. ``JSONDecoder()`` used as default.
100-
package convenience init<Event: Decodable>(
99+
public convenience init<Event: Decodable>(
101100
body: @escaping (Event, LambdaContext) async throws -> Void,
102101
decoder: JSONDecoder = JSONDecoder()
103102
)

Sources/AWSLambdaRuntimeCore/Lambda+JSON.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public struct LambdaHandlerAdapter<
5858
/// Initializes an instance given a concrete handler.
5959
/// - Parameter handler: The ``LambdaHandler`` conforming handler that is to be adapted to ``LambdaWithBackgroundProcessingHandler``.
6060
@inlinable
61-
package init(handler: Handler) {
61+
public init(handler: Handler) {
6262
self.handler = handler
6363
}
6464

@@ -98,7 +98,7 @@ public struct LambdaCodableAdapter<
9898
/// - decoder: The decoder object that will be used to decode the received ``ByteBuffer`` event into the generic ``Event`` type served to the `handler`.
9999
/// - handler: The handler object.
100100
@inlinable
101-
package init(encoder: Encoder, decoder: Decoder, handler: Handler) where Output: Encodable {
101+
public init(encoder: Encoder, decoder: Decoder, handler: Handler) where Output: Encodable {
102102
self.encoder = encoder
103103
self.decoder = decoder
104104
self.handler = handler
@@ -109,7 +109,7 @@ public struct LambdaCodableAdapter<
109109
/// - decoder: The decoder object that will be used to decode the received ``ByteBuffer`` event into the generic ``Event`` type served to the `handler`.
110110
/// - handler: The handler object.
111111
@inlinable
112-
package init(decoder: Decoder, handler: Handler) where Output == Void, Encoder == VoidEncoder {
112+
public init(decoder: Decoder, handler: Handler) where Output == Void, Encoder == VoidEncoder {
113113
self.encoder = VoidEncoder()
114114
self.decoder = decoder
115115
self.handler = handler
@@ -148,7 +148,7 @@ where Output == Encoder.Output {
148148
/// - encoder: The encoder object that will be used to encode the generic ``Output`` into a ``ByteBuffer``, which will then be passed to `streamWriter`.
149149
/// - streamWriter: The underlying ``LambdaResponseStreamWriter`` that will be wrapped.
150150
@inlinable
151-
package init(encoder: Encoder, streamWriter: Base) {
151+
public init(encoder: Encoder, streamWriter: Base) {
152152
self.encoder = encoder
153153
self.underlyingStreamWriter = streamWriter
154154
}

0 commit comments

Comments
 (0)