cache

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotExist = errors.New("cache key does not exist")

Functions

func Exists

func Exists(cache tdl.Cache, key string) bool

func GetOrCreate

func GetOrCreate(cache tdl.Cache, key string, create CreateFunc) (*tdl.CacheItem, error)

func IsNotExist

func IsNotExist(err error) bool

func StoreTar

func StoreTar(bins tdl.Cache, r io.Reader) error

func StoreTarFs

func StoreTarFs(bins tdl.Cache, tar *tarfs.Fs) (err error)

func StoreTarGz

func StoreTarGz(bins tdl.Cache, r io.Reader) error

func Tee

func Tee(cache tdl.Cache, key string, reader io.Reader) (io.ReadCloser, error)

func WriteAll

func WriteAll(cache tdl.Cache, key string, reader io.Reader) error

func WriteString

func WriteString(cache tdl.Cache, key string, data string) error

Types

type CreateFunc

type CreateFunc func() (io.ReadCloser, error)

type Fs

type Fs struct{ afero.Fs }

func NewFs

func NewFs(fs afero.Fs) *Fs

func NewFsAt

func NewFsAt(fs afero.Fs, path string) (*Fs, error)

func NewMemFs

func NewMemFs() *Fs

func NewTmpFs

func NewTmpFs() (*Fs, error)

func (*Fs) Get

func (f *Fs) Get(key string) (*tdl.CacheItem, error)

Get implements tdl.Cache.

func (*Fs) Writer

func (f *Fs) Writer(key string) (io.WriteCloser, error)

Writer implements tdl.Cache.

Jump to

Keyboard shortcuts

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