cache

package
v0.28.4 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheName = map[CacheType]string{
	CacheNone:       "none",
	CacheMemory:     "memory",
	CacheFile:       "file",
	CacheDocker:     "docker",
	CacheContainerd: "containerd",
}

Functions

This section is empty.

Types

type Cache

type Cache interface {
	GetName() string
	Put(key string, p tui.ProgressReader, reader io.ReadCloser) error
	Has(key string) bool
	Get(key string, p tui.ProgressReader, callback func(reader io.ReadCloser) error) error
}

type CacheStruct

type CacheStruct struct {
	Type CacheType
}

func (*CacheStruct) GetName

func (c *CacheStruct) GetName() string

type CacheType

type CacheType int
const (
	CacheNone CacheType = iota
	CacheMemory
	CacheFile
	CacheDocker
	CacheContainerd
)

type ContainerdCache

type ContainerdCache struct {
	CacheStruct
	// contains filtered or unexported fields
}

func NewContainerdCache

func NewContainerdCache(namespace string) (*ContainerdCache, error)

func (*ContainerdCache) Get

func (c *ContainerdCache) Get(key string, p tui.ProgressReader, callback func(reader io.ReadCloser) error) error

func (*ContainerdCache) Has

func (c *ContainerdCache) Has(key string) bool

func (*ContainerdCache) Put

func (c *ContainerdCache) Put(key string, p tui.ProgressReader, reader io.ReadCloser) error

type DockerCache

type DockerCache struct {
	CacheStruct
	// contains filtered or unexported fields
}

func NewDockerCache

func NewDockerCache() (*DockerCache, error)

func (*DockerCache) Get

func (c *DockerCache) Get(key string, p tui.ProgressReader, callback func(reader io.ReadCloser) error) error

func (*DockerCache) Has

func (c *DockerCache) Has(key string) bool

func (*DockerCache) Put

func (c *DockerCache) Put(key string, p tui.ProgressReader, reader io.ReadCloser) error

type FileCache

type FileCache struct {
	CacheStruct
	// contains filtered or unexported fields
}

func NewFileCache

func NewFileCache(directory string, retentionSeconds int) (*FileCache, error)

func (*FileCache) Get

func (c *FileCache) Get(key string, p tui.ProgressReader, callback func(reader io.ReadCloser) error) error

func (*FileCache) Has

func (c *FileCache) Has(key string) bool

func (*FileCache) Put

func (c *FileCache) Put(key string, p tui.ProgressReader, reader io.ReadCloser) error

type MemoryCache

type MemoryCache struct {
	CacheStruct
	// contains filtered or unexported fields
}

func NewMemoryCache

func NewMemoryCache() *MemoryCache

func (*MemoryCache) Get

func (c *MemoryCache) Get(key string, p tui.ProgressReader, callback func(reader io.ReadCloser) error) error

func (*MemoryCache) Has

func (c *MemoryCache) Has(key string) bool

func (*MemoryCache) Put

func (c *MemoryCache) Put(key string, p tui.ProgressReader, reader io.ReadCloser) error

type NoneCache

type NoneCache struct {
	CacheStruct
}

func NewNoneCache

func NewNoneCache() *NoneCache

func (*NoneCache) Get

func (c *NoneCache) Get(key string, p tui.ProgressReader, callback func(reader io.ReadCloser) error) error

func (*NoneCache) Has

func (c *NoneCache) Has(key string) bool

func (*NoneCache) Put

func (c *NoneCache) Put(key string, p tui.ProgressReader, reader io.ReadCloser) error

Jump to

Keyboard shortcuts

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