[Library] Feed library (#4)
This PR contains the work done to setup the library and also, the necessary protocols, model, structs, and error definitions to implement remote service clients. Reviewed-on: rock-n-code/app-reviews#4 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #4.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// ServiceConfiguration.swift
|
||||
// ReviewsiTunesKit
|
||||
//
|
||||
// Created by Javier Cicchelli on 17/03/2024.
|
||||
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ServiceConfiguration {
|
||||
|
||||
// MARK: Constants
|
||||
public let decoder: JSONDecoder
|
||||
public let host: URL
|
||||
public let session: URLSessionConfiguration
|
||||
|
||||
// MARK: Initialisers
|
||||
public init(
|
||||
host: URL,
|
||||
session: URLSessionConfiguration = .ephemeral,
|
||||
decoder: JSONDecoder? = nil
|
||||
) {
|
||||
self.decoder = decoder ?? .init()
|
||||
self.host = host
|
||||
self.session = session
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user