Skip to content

swiftty/DataCacheKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DataCacheKit

A simple data cache interface.

Installation

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/swiftty/DataCacheKit", from: "0.1.2")
]

Usage

import DataCacheKit

// You can choose MemoryCache<<#Key#>, <#Value#>> or Cache<<#Key#>, <#Value#>> as well as DiskCache<<#Key#>>.
let cache = DiskCache<String>(options: .default(path: .default("caches")))

// read
try await cache.value(for: "item0")

// write
cache.store(Data(), for: "item0")

// remove
cache.remove(for: "item0")

// remove all
cache.removeAll()

License

DataCacheKit is available under the MIT license, and uses source code from open source projects. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages