cache

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Has(artifactType string, id string) (string, bool)
	Save(artifactType string, id string, src string) error
	CopyFrom(artifactType string, id string, dst string) error
}

Cache functionality

func NewCache

func NewCache(cacheFolder string, maxContentCacheableSize string) (Cache, error)

NewCache creates a new cache When cacheFolder is empty this constructor will provide a noop cache

type FolderCache

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

FolderCache cache storing the information into a folder in the OS

func (FolderCache) CopyFrom

func (c FolderCache) CopyFrom(artifactType string, id string, dst string) error

CopyFrom the cache into a particular destination

func (FolderCache) Has

func (c FolderCache) Has(artifactType string, id string) (string, bool)

Has checks if a particular entry in the cache is present Returns the path to the entry and a flag information if the entry was found or not

func (FolderCache) Save

func (c FolderCache) Save(artifactType string, id string, src string) error

Save the folder from src in the cache using id If the cache entry exists it will remove it and create a new one

type NoCache

type NoCache struct{}

NoCache is a noop cache

func (*NoCache) CopyFrom

func (c *NoCache) CopyFrom(_, _, _ string) error

CopyFrom does nothing

func (*NoCache) Has

func (c *NoCache) Has(_, _ string) (string, bool)

Has always returns false

func (*NoCache) Save

func (c *NoCache) Save(_, _, _ string) error

Save does nothing

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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