pkg

package
v0.0.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: GPL-3.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPackageSize

func GetPackageSize(url string) (bytes int64, err error)

func RemovePackage

func RemovePackage(pkg string) (err error)

Types

type Dependencies

type Dependencies struct {
	Dependencies         []string `toml:"dependencies"`
	BuildDependencies    []string `toml:"buildDependencies"`
	OptionalDependencies []string `toml:"optionalDependencies"`
}

type Package

type Package struct {
	Name        string `toml:"name"`
	Description string `toml:"description"`
	Version     string `toml:"version"`
	License     string `toml:"license"`
	Homepage    string `toml:"homepage"`
}

type PackageDefinition

type PackageDefinition struct {
	Package Package `toml:"package"`
}

func ParsePackage

func ParsePackage(packageDefinition []byte) (PackageDefinition, error)

Convert data to pkg definition

type PkgData

type PkgData struct {
	PkgDef     PackageDefinition
	VerData    VersionMetadata
	PlfData    PlatformData
	TarURL     string
	RepoURL    string
	Version    string
	Repository string
	BinSize    int64
}

for use with GetPackage(). Contains all data needed to install a package.

func GetPackage

func GetPackage(pkgName string, pkgVersion *string) (pkgData *PkgData, err error)

One function to get all information needed to install a package. Version should be "latest" for latest version. binSize is the size of the tarball in bytes. Probaly going to clean this up and seperate it in seperate functions later.

func NewPkgData

func NewPkgData(PkgDef PackageDefinition, VerData VersionMetadata, PlfData PlatformData, Repository string, Version string, TarURL string, RepoURL string, BinSize int64) *PkgData

func (*PkgData) Download

func (pkg *PkgData) Download(savePath string) (err error)

download and unarchive package.

func (*PkgData) HandleScript

func (pkg *PkgData) HandleScript(name string, savePath string, yes bool) (err error)

func (*PkgData) Install

func (pkg *PkgData) Install(force bool, yes bool) (err error)

type PlatformData

type PlatformData struct {
	Checksum string `toml:"checksum"`
}

type VersionMetadata

type VersionMetadata struct {
	Url             string       `toml:"url"`
	Dependencies    Dependencies `toml:"dependencies"`
	SupportsRosetta bool         `toml:"supportsRosetta"`
	Intel           PlatformData `toml:"intel"`
	Silicon         PlatformData `toml:"silicon"`
}

func ParseVersion

func ParseVersion(versionMetadata []byte) (VersionMetadata, error)

Convert data to version metadata

Jump to

Keyboard shortcuts

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