Skip to content

Commit afd0e69

Browse files
committed
feat: Add comprehensive documentation and enhance library features
- Add complete API documentation for all public interfaces - Implement comprehensive README with usage examples and best practices - Add thread safety documentation and implementation notes - Document all core components: APIClient, NetworkRouter, NetworkError - Add detailed documentation for RetryHandler and DefaultRetryHandler - Document SendablePromise with thread safety examples - Add APIVersion documentation with usage patterns - Document Data extensions with practical examples - Add comprehensive NetworkParameterEncoding documentation - Document HeaderHandler with type-safe header management
1 parent 2febf79 commit afd0e69

20 files changed

+3300
-457
lines changed

Package.swift

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
// swift-tools-version: 6.0
22
import PackageDescription
33

4+
/// SRNetworkManager - A comprehensive networking library for Swift applications
5+
///
6+
/// This package provides a robust, thread-safe networking solution with support for:
7+
/// - Combine and async/await programming models
8+
/// - Automatic retry mechanisms with customizable strategies
9+
/// - Request/response logging with configurable levels
10+
/// - File upload with progress tracking
11+
/// - Streaming responses
12+
/// - Network reachability monitoring
13+
/// - VPN detection
14+
/// - Multipart form data handling
15+
/// - Custom error handling and mapping
16+
/// - Thread-safe operations with proper synchronization
17+
///
18+
/// ## Supported Platforms
19+
/// - iOS 13.0+
20+
/// - macOS 13.0+
21+
/// - tvOS 13.0+
22+
/// - watchOS 7.0+
23+
///
24+
/// ## Key Features
25+
/// - **Dual Programming Models**: Support for both Combine and async/await
26+
/// - **Thread Safety**: All operations are thread-safe with proper synchronization
27+
/// - **Retry Logic**: Configurable retry strategies for failed requests
28+
/// - **Logging**: Comprehensive request/response logging with multiple levels
29+
/// - **Upload Support**: File upload with progress tracking
30+
/// - **Streaming**: Support for streaming responses
31+
/// - **Network Monitoring**: Real-time network connectivity and VPN detection
32+
/// - **Error Handling**: Rich error types with proper mapping
33+
/// - **Parameter Encoding**: Support for JSON, URL-encoded, and multipart form data
434
let package = Package(
535
name: "SRNetworkManager",
636
platforms: [
@@ -20,21 +50,21 @@ let package = Package(
2050
name: "SRNetworkManager",
2151
path: "Sources",
2252
sources: [
23-
"SRNetworkManager",
24-
"HeaderHandler",
25-
"Encoding",
26-
"Log",
27-
"Mime",
28-
"Error",
29-
"Client",
30-
"UploadProgress",
31-
"Router",
32-
"Data",
33-
"Reachability"
53+
"SRNetworkManager", // Main network manager interface
54+
"HeaderHandler", // HTTP header management
55+
"Encoding", // Parameter encoding (JSON, URL, multipart)
56+
"Log", // Request/response logging
57+
"Mime", // MIME type detection
58+
"Error", // Network error definitions
59+
"Client", // Core API client implementation
60+
"UploadProgress", // Upload progress tracking
61+
"Router", // Network routing and URL construction
62+
"Data", // Data extensions and utilities
63+
"Reachability" // Network connectivity monitoring
3464
],
3565
swiftSettings: [
36-
.define("SPM_SWIFT_6"),
37-
.define("SWIFT_PACKAGE")
66+
.define("SPM_SWIFT_6"), // Swift 6 compatibility flag
67+
.define("SWIFT_PACKAGE") // Package manager flag
3868
]
3969
),
4070
.testTarget(
@@ -43,5 +73,5 @@ let package = Package(
4373
path: "Tests/SRNetworkManagerTests"
4474
),
4575
],
46-
swiftLanguageModes: [.v6,.v5]
76+
swiftLanguageModes: [.v6,.v5] // Support for both Swift 5 and 6
4777
)

Package@swift-5.9.swift

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)