pkgmanager

package
v0.0.0-...-c4af43d Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoArchiveURL = errors.New("archive URL not found")

Functions

This section is empty.

Types

type Pkg

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

func (*Pkg) Ecosystem

func (p *Pkg) Ecosystem() pkgecosystem.Ecosystem

func (*Pkg) EcosystemName

func (p *Pkg) EcosystemName() string

func (*Pkg) IsLocal

func (p *Pkg) IsLocal() bool

func (*Pkg) LocalPath

func (p *Pkg) LocalPath() string

func (*Pkg) Manager

func (p *Pkg) Manager() *PkgManager

func (*Pkg) Name

func (p *Pkg) Name() string

func (*Pkg) Version

func (p *Pkg) Version() string

type PkgManager

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

PkgManager represents how packages from a common ecosystem are accessed.

func Manager

func Manager(e pkgecosystem.Ecosystem) *PkgManager

func (*PkgManager) DownloadArchive

func (p *PkgManager) DownloadArchive(name, version, directory string) (string, error)

DownloadArchive downloads an archive of the given package name and version to the specified directory, and returns the path to the downloaded archive. The archive is named according to ecosystem-specific rules.

directory specifies the destination directory for the archive. If an empty string is passed, the current directory is used.

If an error occurs during download of the file, it is returned along with an empty path value.

func (*PkgManager) Ecosystem

func (p *PkgManager) Ecosystem() pkgecosystem.Ecosystem

func (*PkgManager) ExtractArchive

func (p *PkgManager) ExtractArchive(archivePath, outputDir string) error

func (*PkgManager) Latest

func (p *PkgManager) Latest(name string) (*Pkg, error)

func (*PkgManager) Local

func (p *PkgManager) Local(name, version, localPath string) *Pkg

func (*PkgManager) Package

func (p *PkgManager) Package(name, version string) *Pkg

func (*PkgManager) String

func (p *PkgManager) String() string

String implements the Stringer interface to support pretty printing.

Jump to

Keyboard shortcuts

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