cachemirror

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const PathMD5Prefix = "path-md5:"

Variables

This section is empty.

Functions

func DownloadURL

func DownloadURL(baseURL, key string) (string, error)

func KeyForRelPath

func KeyForRelPath(rel string) string

func RelPath

func RelPath(cacheDir, fullPath string) (string, error)

Types

type DownloadResult

type DownloadResult struct {
	Hit  bool
	Size int64
}

func DownloadToFile

func DownloadToFile(ctx context.Context, opts Options, key, target string) (DownloadResult, error)

type Options

type Options struct {
	Enable   bool
	URL      string
	Timeout  time.Duration
	Fallback bool
}

func NormalizeOptions

func NormalizeOptions(opts Options) Options

func (Options) Active

func (opts Options) Active() bool

Jump to

Keyboard shortcuts

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