mirror of
https://github.com/helje5/dockSwiftOnARM.git
synced 2025-11-01 06:33:34 +00:00
28 lines
840 B
Swift
28 lines
840 B
Swift
//
|
|
// Service.swift
|
|
// Services
|
|
//
|
|
// Created by Van Simmons on 2/7/19.
|
|
//
|
|
|
|
import Foundation
|
|
import SmokeHTTP1
|
|
import SmokeOperations
|
|
import SmokeOperationsHTTP1
|
|
import LoggerAPI
|
|
|
|
public protocol Service {
|
|
associatedtype InputType: Codable, Validatable, Equatable
|
|
associatedtype OutputType: Codable, Validatable, Equatable
|
|
|
|
typealias ResultHandlerType = (SmokeResult<OutputType>) -> Void
|
|
|
|
typealias InputDecoderType = (SmokeHTTP1RequestHead, Data?) throws -> InputType
|
|
typealias TransformType = (InputType, ApplicationContext) -> OutputType
|
|
typealias OutputEncoderType = (SmokeHTTP1RequestHead, OutputType, HTTP1ResponseHandler) -> Void
|
|
|
|
static var inputDecoder: InputDecoderType { get }
|
|
static var transform: TransformType { get }
|
|
static var outputEncoder: OutputEncoderType { get }
|
|
}
|