Skip to content

Commit bf6e045

Browse files
authored
Merge pull request #4 from swiftty/readme
update README
2 parents 6e1a54b + f36839b commit bf6e045

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
11
# DataCacheKit
22

3-
A description of this package.
3+
A simple data cache interface.
4+
5+
## Installation
6+
7+
### Swift Package Manager
8+
9+
```swift
10+
dependencies: [
11+
.package(url: "https://github.com/swiftty/DataCacheKit", from: "0.0.1")
12+
]
13+
```
14+
15+
## Usage
16+
17+
```swift
18+
import DataCacheKit
19+
20+
// You can choose MemoryCache<<#Key#>, <#Value#>> or Cache<<#Key#>, <#Value#>> as well as DiskCache<<#Key#>>.
21+
let cache = DiskCache<String>(options: .default(path: .default("caches")))
22+
23+
// read
24+
try await cache.value(for: "item0")
25+
26+
// write
27+
cache.store(Data(), for: "item0")
28+
29+
// remove
30+
cache.remove(for: "item0")
31+
32+
// remove all
33+
cache.removeAll()
34+
```
35+
36+
## License
37+
38+
DataCacheKit is available under the MIT license, and uses source code from open source projects. See the [LICENSE](https://github.com/swiftty/DataCacheKit/blob/main/LICENSE) file for more info.

0 commit comments

Comments
 (0)