Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/surfstudio/nodekit
https://github.com/surfstudio/nodekit
customizable hacktoberfest ios network nodekit requests surf surfstudio
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/surfstudio/nodekit
- Owner: surfstudio
- License: mit
- Created: 2017-09-26T17:01:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T12:31:18.000Z (8 months ago)
- Last Synced: 2024-05-13T13:33:35.322Z (8 months ago)
- Topics: customizable, hacktoberfest, ios, network, nodekit, requests, surf, surfstudio
- Language: Swift
- Homepage: https://surfstudio.github.io/NodeKit
- Size: 42.3 MB
- Stars: 27
- Watchers: 27
- Forks: 9
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# NodeKit
[![GitHubActions Build Status](https://github.com/surfstudio/NodeKit/workflows/CI/badge.svg)](https://github.com/surfstudio/NodeKit/actions)
[![codecov](https://codecov.io/gh/surfstudio/NodeKit/branch/master/graph/badge.svg)](https://codecov.io/gh/surfstudio/NodeKit)
[![SPM Compatible](https://img.shields.io/badge/SPM-compatible-blue.svg)](https://github.com/apple/swift-package-manager)Flexible and customizable network library
---
## About
The NodeKit library enables rapid and easy creation of requests of varying complexity. The system operates on the principle of asynchronous data transformation, wherein nodes are interconnected to form a chain that transforms input data into a server response.
![All text](TechDocs/NodeKitHeader.svg)
Such an approach allows us to flexibly adapt to a wide range of requirements.
## Build request using Swift Concurrency
```Swift
import NodeKit
// Define endpoints
enum Endpoint: URLRouteProvider {
case authfunc url() throws -> URL {
switch self {
case .auth:
return URL(string: "http://nodekit.com/auth")!
}
}
}// Build async request that takes AuthModel
func requestCredentials(authModel: AuthModel) async -> NodeResult {
return await URLChainBuilder()
.route(.post, .users)
.encode(as: .urlQuery)
.build()
.process(authModel)
}```
## Build request using Combine
```swift
func credentialsPublisher(for authModel: AuthModel) -> AnyPublisher, Never> {
return URLChainBuilder()
.route(.post, .users)
.encode(as: .urlQuery)
.build()
.nodeResultPublisher(for: authModel)
}```
## Installation
### Swift Package Manager
Using Xcode:
- Go to File > Swift Packages > Add Package Dependency
- Enter the URL of repository https://github.com/surfstudio/NodeKit.gitUsing Package.swift file:
Write dependency:
```swift
dependencies: [
.package(url: "https://github.com/surfstudio/NodeKit.git", .upToNextMajor(from: "5.0.0"))
]
```## Features
- Swift Concurrency
- Combine
- MultipartFormData
- URL QUERY / JSON / FORM URL Parameter Encoding
- Mapping JSON to Struct or Class Models
- Token refresher
- URLCach reader and writer
- Comprehensive Unit and Integration Test Coverage
- Mock target for Unit tests
- [Documentation](TechDocs/Documentation.md)
- [Code documentation](https://surfstudio.github.io/NodeKit/documentation/nodekit)## Contributing
If you want to contribute to NodeKit, please read the [guide](TechDocs/ContributionGuide.md) beforehand.
## Changelog
The list of changes you can found [here](CHANGELOG.md).
## License
NodeKit is released under the MIT license. See [LICENSE](LICENSE) for details.