registry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PackageMetadata

type PackageMetadata struct {
	Name     string                 `json:"name"`
	Versions map[string]VersionInfo `json:"versions"`
	DistTags map[string]string      `json:"dist-tags"`
}

PackageMetadata represents the npm package metadata

type RegistryClient

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

RegistryClient handles communication with the npm registry

func NewRegistryClient

func NewRegistryClient(log *logger.Logger) *RegistryClient

NewRegistryClient creates a new registry client

func (*RegistryClient) GetLatestVersion

func (c *RegistryClient) GetLatestVersion(name string) (*VersionInfo, error)

GetLatestVersion fetches the latest version of a package

func (*RegistryClient) GetPackageMetadata

func (c *RegistryClient) GetPackageMetadata(name string) (*PackageMetadata, error)

GetPackageMetadata fetches metadata for a package

func (*RegistryClient) GetPackageVersion

func (c *RegistryClient) GetPackageVersion(name, versionConstraint string) (*VersionInfo, error)

GetPackageVersion fetches metadata for a specific version of a package

func (*RegistryClient) SetBaseURL

func (c *RegistryClient) SetBaseURL(url string)

type RetryConfig

type RetryConfig struct {
	MaxRetries  int
	RetryDelay  time.Duration
	MaxWaitTime time.Duration
}

RetryConfig holds retry-related configuration

type VersionInfo

type VersionInfo struct {
	Version      string            `json:"version"`
	Dependencies map[string]string `json:"dependencies,omitempty"`
	Dist         struct {
		Tarball string `json:"tarball"`
		Shasum  string `json:"shasum"`
	} `json:"dist"`
}

VersionInfo contains metadata about a specific package version

Jump to

Keyboard shortcuts

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