Skip to content

Commit

Permalink
Merge pull request #10 from theisegeberg/main
Browse files Browse the repository at this point in the history
Public memberwise initialiser for APIClient.Configuration
  • Loading branch information
kean authored Dec 10, 2021
2 parents 8005e5b + 9fbba80 commit c91670d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/APIClient/APIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ public actor APIClient {
/// By default, uses encoder with `.iso8601` date encoding strategy.
public var encoder: JSONEncoder?
public var delegate: APIClientDelegate?

public init(host: String, port: Int? = nil, isInsecure: Bool = false, sessionConfiguration: URLSessionConfiguration = .default, decoder: JSONDecoder? = nil, encoder: JSONEncoder? = nil, delegate: APIClientDelegate? = nil) {
self.host = host
self.port = port
self.isInsecure = isInsecure
self.sessionConfiguration = sessionConfiguration
self.decoder = decoder
self.encoder = encoder
self.delegate = delegate
}
}

/// Initializes the client with the given parameters.
Expand Down

0 comments on commit c91670d

Please sign in to comment.