Documentation
¶
Index ¶
- type ChunkRow
- type DB
- func (db *DB) ClearHostCaps() error
- func (db *DB) DeleteChunks(url, dest string) error
- func (db *DB) DeleteChunksTx(tx *sql.Tx, url, dest string) error
- func (db *DB) DeleteDownload(url, dest string) error
- func (db *DB) DeleteHostCaps(host string) error
- func (db *DB) GetHostCaps(host string) (HostCaps, bool, error)
- func (db *DB) IncDownloadRetries(url, dest string, delta int64) error
- func (db *DB) InitChunksTable() error
- func (db *DB) InitHostCapsTable() error
- func (db *DB) ListChunks(url, dest string) ([]ChunkRow, error)
- func (db *DB) ListDownloads() ([]DownloadRow, error)
- func (db *DB) ListHostCaps() ([]HostCaps, error)
- func (db *DB) UpdateChunkSHA(url, dest string, idx int, sha string) error
- func (db *DB) UpdateChunkSHATx(tx *sql.Tx, url, dest string, idx int, sha string) error
- func (db *DB) UpdateChunkStatus(url, dest string, idx int, status string) error
- func (db *DB) UpdateChunkStatusTx(tx *sql.Tx, url, dest string, idx int, status string) error
- func (db *DB) UpdateDownloadStatus(url, dest, status, lastError string) error
- func (db *DB) UpsertChunk(c ChunkRow) error
- func (db *DB) UpsertChunkTx(tx *sql.Tx, c ChunkRow) error
- func (db *DB) UpsertDownload(row DownloadRow) error
- func (db *DB) UpsertHostCaps(host string, headOK, acceptRanges bool) error
- func (db *DB) WithTx(fn func(tx *sql.Tx) error) error
- type DownloadRow
- type HostCaps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
func (*DB) ClearHostCaps ¶
ClearHostCaps deletes all host capabilities from the cache.
func (*DB) DeleteChunks ¶
DeleteChunks removes all chunk rows for a given url+dest pair.
func (*DB) DeleteDownload ¶
DeleteDownload removes a download row for the given url+dest.
func (*DB) DeleteHostCaps ¶
DeleteHostCaps deletes a single host from the cache.
func (*DB) IncDownloadRetries ¶
IncDownloadRetries increments the retries counter for a download row.
func (*DB) InitChunksTable ¶
func (*DB) InitHostCapsTable ¶
func (*DB) ListDownloads ¶
func (db *DB) ListDownloads() ([]DownloadRow, error)
ListDownloads returns a snapshot of the downloads table
func (*DB) ListHostCaps ¶
ListHostCaps returns all cached host capabilities.
func (*DB) UpdateChunkSHA ¶
func (*DB) UpdateChunkSHATx ¶
func (*DB) UpdateChunkStatus ¶
func (*DB) UpdateChunkStatusTx ¶
func (*DB) UpdateDownloadStatus ¶
UpdateDownloadStatus updates only status and last_error, preserving other fields.
func (*DB) UpsertChunk ¶
func (*DB) UpsertChunkTx ¶
Tx variants for grouping operations atomically
func (*DB) UpsertDownload ¶
func (db *DB) UpsertDownload(row DownloadRow) error
func (*DB) UpsertHostCaps ¶
type DownloadRow ¶
Click to show internal directories.
Click to hide internal directories.