registry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasQuarantineCacheEntry

func HasQuarantineCacheEntry(cacheDir, ecosystem, name string) bool

HasQuarantineCacheEntry reports whether npm holding status was checked before.

func IsNPMSecurityVersion

func IsNPMSecurityVersion(ecosystem, version string) bool

IsNPMSecurityVersion reports whether version is npm's *-security stub suffix.

func IsQuarantinedCached

func IsQuarantinedCached(cacheDir, ecosystem, name string) bool

IsQuarantinedCached reports whether npm package name is known quarantined on disk.

func NPMRegistryBaseForTest

func NPMRegistryBaseForTest() string

NPMRegistryBaseForTest returns the npm registry base URL.

func PackagePageURL

func PackagePageURL(ecosystem, name string) string

PackagePageURL returns a human-facing registry page for a package, if known.

func QuarantineCachePath

func QuarantineCachePath(cacheDir string) string

func RefreshNPMQuarantineCache

func RefreshNPMQuarantineCache(ctx context.Context, cacheDir, userAgent string, timeout time.Duration, names []string)

RefreshNPMQuarantineCache checks npm holding status for names and persists results.

func SetNPMRegistryBaseForTest

func SetNPMRegistryBaseForTest(base string)

SetNPMRegistryBaseForTest overrides the npm registry base URL in tests.

func SetQuarantined

func SetQuarantined(cacheDir, ecosystem, name string, quarantined bool) error

SetQuarantined persists quarantine status for an npm package.

Types

type Client

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

func NewClient

func NewClient(userAgent string, timeout time.Duration) *Client

func (*Client) Exists

func (c *Client) Exists(ctx context.Context, ecosystem, name, version string) (bool, error)

Exists reports whether a package name is published in the given ecosystem registry.

func (*Client) FindInEcosystems

func (c *Client) FindInEcosystems(ctx context.Context, name, version string, ecosystems []string) []string

FindInEcosystems returns ecosystems where the package name exists in the registry.

func (*Client) IsNPMSecurityHolding

func (c *Client) IsNPMSecurityHolding(ctx context.Context, name string) (bool, error)

IsNPMSecurityHolding reports whether npm registry publishes only *-security placeholder version(s) for name (takedown holding package).

func (*Client) ShouldSkipPlaceholder

func (c *Client) ShouldSkipPlaceholder(ctx context.Context, ecosystem, name, version string) (bool, error)

ShouldSkipPlaceholder returns true for npm registry security stubs: either the dependency version is *-security or npm only publishes holding versions.

func (*Client) Status

func (c *Client) Status(ctx context.Context, pkg ref.PackageRef) (*Status, error)

type Status

type Status struct {
	Status   string `json:"status"`
	Yanked   bool   `json:"yanked"`
	YankedAt string `json:"yanked_at,omitempty"`
}

Jump to

Keyboard shortcuts

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