apt

package
v0.0.0-...-c74b300 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCacheCorrupted = errors.New("apt cache validation failed")

Functions

func CachePath

func CachePath(root, host, requestPath string) string

func DecompressByName

func DecompressByName(filename string, reader io.Reader) (io.Reader, error)

func HashFile

func HashFile(path string) (string, error)

func IsHashRequest

func IsHashRequest(path string) bool

func IsIndexFile

func IsIndexFile(path string) bool

func ParseHashPath

func ParseHashPath(path string) (algorithm, hash string, err error)

func SanitizeHost

func SanitizeHost(host string) string

Types

type Index

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

func NewIndex

func NewIndex(cacheRoot string) *Index

func (*Index) LoadExpected

func (i *Index) LoadExpected(records []hashstore.Expected)

func (*Index) LoadFile

func (i *Index) LoadFile(cachePath string) error

func (*Index) LoadFileByHash

func (i *Index) LoadFileByHash(cachePath, requestPath string) error

func (*Index) LoadFromRoot

func (i *Index) LoadFromRoot(root string) error

func (*Index) SetHashStore

func (i *Index) SetHashStore(store *hashstore.Store)

func (*Index) ValidateByHash

func (i *Index) ValidateByHash(cachePath, filePath, requestPath string) error

func (*Index) ValidateDeb

func (i *Index) ValidateDeb(cachePath, filePath string) error

func (*Index) ValidateFile

func (i *Index) ValidateFile(cachePath, filePath string) error

type PackageFile

type PackageFile struct {
	Package  string
	Filename string
	Size     int64
	SHA256   string
}

func ParsePackages

func ParsePackages(reader io.Reader) []PackageFile

func ParseRelease

func ParseRelease(reader io.Reader) []PackageFile

type Record

type Record struct {
	Path string
	Hash string
	Size int64
}

Jump to

Keyboard shortcuts

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