This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Network | |
import NIO | |
import NIOHTTP1 | |
import NIOTransportServices | |
/// Channel Handler for serializing request header and data | |
class HTTPClientRequestSerializer : ChannelOutboundHandler { | |
typealias OutboundIn = Void | |
typealias OutboundOut = HTTPClientRequestPart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AWSSDKSwiftCore | |
import CryptoSwift | |
import Foundation | |
extension Array where Element: FixedWidthInteger { | |
static func random(count: Int) -> [Element] { | |
var array = self.init() | |
for _ in 0..<count { | |
array.append(.random(in: Element.min..<Element.max)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vapor | |
/// Middleware for outputting all http requests and their responses | |
final class LoggingMiddleware : Middleware, ServiceType { | |
static func makeService(for container: Container) throws -> Self { | |
return try .init(environment: container.environment, log: container.make()) | |
} | |
init(environment: Environment, log: Logger) { | |
self.environment = environment |
NewerOlder