FLFoundationFactory
public enum FLFoundationFactory
The factory class for module FLFoundation.
This class has methods to create types exposed by this module.
-
API to create a
SessionTaskDeclaration
Swift
public static func sessionTask(requestProvider: URLRequestProvider) -> SessionTaskParameters
requestProviderrequest provider for this task
-
API to create
HTTPClientHTTPClient instance provides APIs to perform URL loading tasks.
Declaration
Swift
public static func httpClient(configuration: URLSessionConfiguration = .default, defaultHeaders: Headers? = nil) -> HTTPClientParameters
configurationURLSessionConfigurationobject if any for the underlyingURLSessiondefaultHeadersDefault
Headersto be added to all requests performed by this instance -
API to create
HTTPClientHTTPClient instance provides APIs to perform URL loading tasks.
Declaration
Swift
public static func httpClient(session: Session, defaultHeaders: Headers? = nil) -> HTTPClient -
API to create Key-Value storage service with
KeyValueStoreas the underlying service provider.Declaration
Swift
public static func keyValueStore(name: String, storeDirectory: String? = nil) -> KeyValueStoreParameters
nameThe name of the store.
-
The unified logger service with
OSLogas the underlying service provider.Custom log objects are identified by an identifier string (in reverse DNS notation, like com.your_company.your_subsystem_name) and a category for the logging subsystem. Both of these are used to categorize and filter related log messages and group related logging settings.
Declaration
Swift
public static func logger(with subsystem: String, category: String) -> LoggerParameters
subsystemsubsystem
categorycategory
-
The
FLErrorconformed struct objectDeclaration
Parameters
errorCodeerror code of this error in context
errorDescriptionerror desciption of the error in context
internalErrorinternal error for the error in context
contextualDescriptioncontextual description of the error in context
-
The
FLExceptionErrorconformed struct objectDeclaration
Swift
public static func error(errorCode: Int, errorDescription: String, internalError: FLError? = nil, contextualDescription: String? = nil, exceptionError: Error) -> FLExceptionErrorParameters
errorCodeerror code of this error in context
errorDescriptionerror desciption of the error in context
internalErrorinternal error for the error in context
contextualDescriptioncontextual description of the error in context
exceptionErrorexception error that caused the error in context
-
API to create FLDeviceSecurity instance.
Declaration
Swift
public static func flDeviceSecurity() -> FLDeviceSecurity -
Undocumented
Declaration
Swift
public static func createVMapParser(url: String, allCases: [VMapParser.Element]) -> VMapParser -
API to retrive array of WebVTTModel with http request
User requested with remote url and completion give it back response to user
Note
Default value is provided for http client with default configuration.Declaration
Swift
public static func retriveWebVTT( for url: String, client: HTTPClient = FLFoundationFactory.httpClient(), completion: @escaping (Result<[WebVTTModel], Error>) -> Void )Parameters
urlremote url
clientTo make an network request
-
Builds a default user agent string from system information.
Constructs a user agent string matching the format:
AppName/AppVersion (DeviceType; U; CPU OS <version> like Mac OS X; <DeviceModel> Build/<BuildID>)Example:
"Quickplay/2.1.0 (iPhone; U; CPU OS 18_4_1 like Mac OS X; iPhone15,2 Build/22E252)"This is used as the fallback
User-Agentheader when no custom user agent is provided in the session configuration.Declaration
Swift
public static func buildUserAgent() -> StringReturn Value
A formatted user agent string