cache

package
v0.0.0-...-848f105 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExpired

func IsExpired(file storage.FileEntry) bool

IsExpired checks if the cache is expired.

Types

type Cache

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

Cache defines a basic cache object.

func New

New creates a new cache object.

func NewDefault

func NewDefault(s storage.Storage) Cache

NewDefault creates a new cache object with tar format.

func (Cache) Rebuild

func (c Cache) Rebuild(srcs []string, dst string) error

Rebuild rebuilds the new cache.

func (Cache) Restore

func (c Cache) Restore(src string, fallback string) error

Restore restores the existing cache.

type DirtyFunc

type DirtyFunc func(storage.FileEntry) bool

DirtyFunc defines when an cache item is outdated.

type Flusher

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

Flusher defines an object to clear the cache.

func NewDefaultFlusher

func NewDefaultFlusher(s storage.Storage) Flusher

NewDefaultFlusher creates a new cache flusher with default expire.

func NewFlusher

func NewFlusher(s storage.Storage, fn DirtyFunc) Flusher

NewFlusher creates a new cache flusher.

func (*Flusher) Flush

func (f *Flusher) Flush(src string) error

Flush cleans the cache if it's expired.

Jump to

Keyboard shortcuts

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