Defined the Endpoint protocol in the Feed library.
This commit is contained in:
parent
8dacbfd51d
commit
6245e87a98
32
Libraries/Feed/Kit/Sources/Protocols/Endpoint.swift
Normal file
32
Libraries/Feed/Kit/Sources/Protocols/Endpoint.swift
Normal file
@ -0,0 +1,32 @@
|
||||
//
|
||||
// Endpoint.swift
|
||||
// ReviewsFeedKit
|
||||
//
|
||||
// Created by Javier Cicchelli on 17/03/2024.
|
||||
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public protocol Endpoint {
|
||||
|
||||
// MARK: Associated types
|
||||
associatedtype Input: EndpointInput
|
||||
associatedtype Output: EndpointOutput
|
||||
|
||||
// MARK: Properties
|
||||
var host: URL { get }
|
||||
var decoder: JSONDecoder { get }
|
||||
var session: URLSession { get }
|
||||
|
||||
// MARK: Functions
|
||||
func callAsFunction(_ input: Input) async throws -> Output
|
||||
func makePath(with input: Input) throws -> String
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Input
|
||||
public protocol EndpointInput {}
|
||||
|
||||
// MARK: - Output
|
||||
public protocol EndpointOutput {}
|
Loading…
x
Reference in New Issue
Block a user