-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBicepsConfiguartions.swift
57 lines (38 loc) · 1.66 KB
/
BicepsConfiguartions.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// BicepsConfiguartions.swift
// HomeNAS
//
// Created by SDH on 03/04/2017.
// Copyright © 2017 sdaheng. All rights reserved.
//
import Foundation
// MARK: Biceps Configuration
protocol BicepsConfigurable {
var headers: [String:String]? { get set }
var logLevel: BicepsLogLevel { get set }
var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? { get set }
var backgroundCompletionHander: BackgroundCompletionHandler? { get set }
}
protocol BicepsDelegatable {
}
extension BicepsConfigurable {
var logLevel: BicepsLogLevel {
return .Off
}
}
open class BicepsGeneralConfiguration: BicepsConfigurable {
open var backgroundCompletionHander: BackgroundCompletionHandler?
open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)?
open static let shared = BicepsGeneralConfiguration()
open var logLevel: BicepsLogLevel = .Off
open var headers: [String : String]?
private var allowCache: Bool = true
open var interceptor: BicepsInterceptable?
init() {}
}
open class BicepsConfiguration: BicepsConfigurable {
internal var backgroundCompletionHander: BackgroundCompletionHandler?
internal var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)?
open var logLevel: BicepsLogLevel = .Off
open var headers: [String : String]?
}