inventory

package
v1.0.0-beta.17 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bin

type Bin struct {
	Name     string
	Versions []*Version
	Source   string
	Owner    string
	Repo     string
}

func (*Bin) GetInstallPath

func (b *Bin) GetInstallPath(base string) string

func (*Bin) ListVersions

func (b *Bin) ListVersions() []string

type Inventory

type Inventory struct {
	Bins map[string]*Bin
	// contains filtered or unexported fields
}

func New

func New(fileSystem fs.FS, basePath, binPath string, cfg *config.Config) *Inventory

func (*Inventory) AddVersion

func (i *Inventory) AddVersion(path, target string) error

func (*Inventory) Count

func (i *Inventory) Count() int

func (*Inventory) FullCount

func (i *Inventory) FullCount() int

func (*Inventory) GetBinVersion

func (i *Inventory) GetBinVersion(name, version string) *Version

func (*Inventory) GetBinVersions

func (i *Inventory) GetBinVersions(name string) *Bin

func (*Inventory) GetBinsSortedKeys

func (i *Inventory) GetBinsSortedKeys() []string

func (*Inventory) GetLatestVersion

func (i *Inventory) GetLatestVersion(name string) *Version

func (*Inventory) SetConfig

func (i *Inventory) SetConfig(cfg *config.Config)

SetConfig - set the configuration for the inventory - primarily used for tests only

type Version

type Version struct {
	Version string
	Path    string
	Latest  bool
	Target  string
}

Jump to

Keyboard shortcuts

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