public struct Config
Represents the config used in a
The file size limit on disk of the storage in bytes. 0 means no limit.
public var sizeLimit: UInt
The preferred extension of cache item. It will be appended to the file name as its extension. Default is
nil, means that the cache file does not contain a file extension.
public var pathExtension: String?
true, means that the cache file name will be hashed before storing.
public var usesHashedFileName: Bool
Creates a config value based on given parameters.
public init( name: String, sizeLimit: UInt, fileManager: FileManager = .default, directory: URL? = nil)
The name of cache. It is used as a part of storage folder. It is used to identify the disk storage. Two storages with the same
namewould share the same folder in disk, and it should be prevented.
The size limit in bytes for all existing files in the disk storage.
FileManagerused to manipulate files on disk. Default is
The URL where the disk storage should live. The storage will use this as the root folder, and append a path which is constructed by input
name. Default is
nil, indicates that the cache directory under user domain mask will be used.