Documentation
¶
Overview ¶
Package registry fetches package metadata and archives from npm and PyPI.
Index ¶
Constants ¶
View Source
const ( MaxArchiveBytes = 80 << 20 // 80 MiB compressed download cap MaxFileBytes = 2 << 20 // 2 MiB per extracted file (enough for source) MaxFilesPerPkg = 4000 // hard cap of files inspected per package MaxTotalUnpacked = 256 << 20 )
Limits applied while downloading and extracting archives. They keep memory bounded and defend against decompression bombs shipped by hostile packages.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct {
Name string
Version string
PublishedAt time.Time // when this exact version was published
FirstPublishedAt time.Time // when the package first appeared
Maintainers []string
// InstallScripts are lifecycle hooks declared in the manifest
// (npm: preinstall/install/postinstall — the Shai-Hulud entry point).
InstallScripts map[string]string
TarballURL string
}
Metadata is registry-level information about a specific package version.
type NPMClient ¶
type NPMClient struct {
BaseURL string // default https://registry.npmjs.org
}
NPMClient talks to the public npm registry (or a compatible mirror).
type PyPIClient ¶
type PyPIClient struct {
BaseURL string // default https://pypi.org
}
PyPIClient talks to the public PyPI JSON API.
func NewPyPI ¶
func NewPyPI() *PyPIClient
Click to show internal directories.
Click to hide internal directories.