package download
import "github.com/ethereum/go-ethereum/internal/download"
Package download implements checksum-verified file downloads.
Index ¶
- type ChecksumDB
- func MustLoadChecksums(file string) *ChecksumDB
- func ParseChecksums(input []byte) (*ChecksumDB, error)
- func (db *ChecksumDB) DownloadAndVerifyAll()
- func (db *ChecksumDB) DownloadFile(url, dstPath string) error
- func (db *ChecksumDB) DownloadFileFromKnownURL(dstPath string) error
- func (db *ChecksumDB) Files() iter.Seq[string]
- func (db *ChecksumDB) FindURL(basename string) (string, error)
- func (db *ChecksumDB) FindVersion(tool string) (string, error)
Types ¶
type ChecksumDB ¶
type ChecksumDB struct {
// contains filtered or unexported fields
}
ChecksumDB keeps file checksums and tool versions.
func MustLoadChecksums ¶
func MustLoadChecksums(file string) *ChecksumDB
MustLoadChecksums loads a file containing checksums.
func ParseChecksums ¶
func ParseChecksums(input []byte) (*ChecksumDB, error)
ParseChecksums parses a checksum database.
func (*ChecksumDB) DownloadAndVerifyAll ¶
func (db *ChecksumDB) DownloadAndVerifyAll()
DownloadAndVerifyAll downloads all files and checks that they match the checksum given in the database. This task can be used to sanity-check new checksums.
func (*ChecksumDB) DownloadFile ¶
func (db *ChecksumDB) DownloadFile(url, dstPath string) error
DownloadFile downloads a file and verifies its checksum.
func (*ChecksumDB) DownloadFileFromKnownURL ¶
func (db *ChecksumDB) DownloadFileFromKnownURL(dstPath string) error
DownloadFileFromKnownURL downloads a file from the URL defined in the checksum database.
func (*ChecksumDB) Files ¶
func (db *ChecksumDB) Files() iter.Seq[string]
Files returns an iterator over all file names.
func (*ChecksumDB) FindURL ¶
func (db *ChecksumDB) FindURL(basename string) (string, error)
FindURL gets the URL for a file.
func (*ChecksumDB) FindVersion ¶
func (db *ChecksumDB) FindVersion(tool string) (string, error)
FindVersion returns the current known version of a tool, if it is defined in the file.
Source Files ¶
- Version
- v1.16.1 (latest)
- Published
- Jul 2, 2025
- Platform
- linux/amd64
- Imports
- 12 packages
- Last checked
- 35 minutes ago –
Tools for package owners.