dlcache

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetPaths(ctx context.Context) *config.Paths
}

type DownloadCache

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

func New

func New(cfg Config) *DownloadCache

func (*DownloadCache) BasePath

func (dc *DownloadCache) BasePath(ctx context.Context) string

func (*DownloadCache) Get

func (dc *DownloadCache) Get(ctx context.Context, id string) (string, bool)

Get checks if an entry with the given ID already exists in the cache, and if so, returns the directory and true. If it does not exist, it returns an empty string and false.

func (*DownloadCache) New

func (dc *DownloadCache) New(ctx context.Context, id string) (string, error)

New creates a new directory with the given ID in the cache. If a directory with the same ID already exists, it will be deleted before creating a new one.

Jump to

Keyboard shortcuts

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