Documentation
¶
Overview ¶
Package cache manages downloaded files and their metadata.
Index ¶
- type DownloadOptions
- type DownloadResult
- type Entry
- type Manager
- func (m *Manager) Download(ctx context.Context, opts DownloadOptions, authToken string, ...) (*DownloadResult, error)
- func (m *Manager) GetEntry(licenseKey string, downloadID, version string) (*Entry, error)
- func (m *Manager) List() ([]*Entry, error)
- func (m *Manager) ListForLicense(licenseKey string) ([]*Entry, error)
- func (m *Manager) PurgeAll() error
- func (m *Manager) PurgeLicense(licenseKey string) error
- func (m *Manager) Verify(entry *Entry) (bool, error)
- type ProgressCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DownloadOptions ¶
type DownloadOptions struct {
LicenseKey string
DownloadID string // e.g., "xenforo", "xfmg"
Version string
URL string
Filename string // overrides Content-Disposition
SkipCacheCheck bool
// contains filtered or unexported fields
}
DownloadOptions specifies download parameters.
type DownloadResult ¶
DownloadResult contains information about a completed download.
type Entry ¶
Entry represents a cached download file.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages cache storage on disk.
func (*Manager) Download ¶
func (m *Manager) Download(ctx context.Context, opts DownloadOptions, authToken string, progress ProgressCallback) (*DownloadResult, error)
Download downloads and caches a file, optionally using an authentication token.
func (*Manager) ListForLicense ¶
ListForLicense returns all cached entries for a specific license.
func (*Manager) PurgeLicense ¶
PurgeLicense removes all cached files for a specific license.
type ProgressCallback ¶
type ProgressCallback func(current, total int64)
ProgressCallback reports download progress; total is -1 if unknown.
Click to show internal directories.
Click to hide internal directories.