public struct Config
Represents the config used in a
Represents a set of conception related to storage which stores a certain type of value in disk. This is a namespace for the disk storage types. A
Backendwith a certain
Configwill be used to describe the storage. See these composed types for more information.
public init( name: String, sizeLimit: UInt, fileManager: FileManager = .default, directory: URL? = nil)
Creates a config value based on given parameters.
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
The size limit in bytes for all existing files in the disk storage.
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
public var sizeLimit: UInt
The file size limit on disk of the storage in bytes. 0 means no limit.
public var expiration: StorageExpiration
StorageExpiration used in this disk storage. Default is
means that the disk cache would expire in one week.
public var pathExtension: String? = nil
The preferred extension of cache item. It will be appended to the file name as its extension.
nil, means that the cache file does not contain a file extension.
public var usesHashedFileName = true
true, means that the cache file name will be hashed before storing.
public var autoExtAfterHashedFileName = false
If set to
true, image extension will be extracted from original file name and append to
the hased file name and used as the cache key on disk.