Skip to content

STRUCT

Cache

Contents

  • Properties
    • profiles
    • path
    • version
  • Methods
    • init(profiles:path:version:)
    • cache(profiles:path:version:)
swift
public struct Cache: Codable, Hashable

A cache configuration.

Properties

profiles

swift
public var profiles: [Profile]

A list of the cache profiles.

path

swift
public var path: FilePath?

The path where the cache will be stored, if nil it will be a default location in a shared directory.

version

swift
public var version: String?

Unique identifier of cached artifacts. Can be used to invalidate cache if needed.

Methods

init(profiles:path:version:)

swift
public init(profiles: [Profile], path: AbsolutePath?, version: String? = nil)

cache(profiles:path:version:)

swift
public static func cache(profiles: [Profile] = [], path: FilePath? = nil, version: String? = nil) -> Cache

Returns a Cache instance containing the given profiles. If no profile list is provided, geko's default profile will be taken as the default. If no profile is provided in geko cache --profile command, the first profile from the profiles list will be taken as the default.

  • Parameters:
    • profiles: Profiles to be chosen from
    • path: The path where the cache will be stored, if nil it will be a default location in a shared directory.
    • version: Unique identifier of cached artifacts. Can be used to invalidate cache if needed.
  • Returns: The Cache instance

Parameters

NameDescription
profilesProfiles to be chosen from
pathThe path where the cache will be stored, if nil it will be a default location in a shared directory.
versionUnique identifier of cached artifacts. Can be used to invalidate cache if needed.