cache

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cache provides functionality for managing a cache located on the file system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache represents a cache located on the file system.

func New

func New(location string, ephemeral bool) (Cache, error)

New creates an uninitialized cache.

If location is an empty string the location will default to the user's home directory.

If ephemeral is set the cache will be located in a unique directory in the system's temporary directory (and the given location is ignored).

func (*Cache) Cleanup

func (c *Cache) Cleanup()

Cleanup removes the cache if it is ephemeral, ignoring errors.

func (*Cache) Clear

func (c *Cache) Clear() error

Clear removes the contents of the cache.

func (*Cache) Init

func (c *Cache) Init() error

Init sets up the cache (if necessary).

func (*Cache) Path

func (c *Cache) Path() string

Path returns the path to the cache on the file system.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL