pkgparse

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GOOStoPkgOs = map[string]string{
	"darwin":  "macos",
	"windows": "win",
	"linux":   "linux",
}

Functions

func CheckUsing

func CheckUsing(pkg string) (*string, error)

Check using file. If UsingFile doesn't exist, it is not using anything

func ParseVersion

func ParseVersion(versionStr string, versionFmt string) (*string, error)

func RemoveUsing

func RemoveUsing(pkg string) error

func WriteUsing

func WriteUsing(pkg string, using string) error

Types

type ArchLinuxPkgInfo

type ArchLinuxPkgInfo struct {
	PkgVer string
}

type AssetInfo

type AssetInfo struct {
	Name               string
	Size               uint32
	BrowserDownloadUrl string `json:"browser_download_url"`
}

type OsArchPair

type OsArchPair struct {
	Os   string `yaml:"os"`
	Arch string `yaml:"arch"`
}

type OsInfo

type OsInfo struct {
	Name                   string        `yaml:"name"`
	Ext                    string        `yaml:"ext"`
	BinPaths               SingleOrMulti `yaml:"bin_path"`
	ExtractHasRoot         bool          `yaml:"extract_has_root"`
	IsRawBinary            bool          `yaml:"is_raw_binary"`
	FilenameFormatOverride string        `yaml:"filename_format_override"`
	Renames                []RenameItem  `yaml:"renames"`
}

type PkgConfig

type PkgConfig struct {
	Title   string
	Tagline string
	About   string

	InfoUrl         string `yaml:"info_url"`
	ReleasesUrl     string `yaml:"releases_url"`
	BaseDownloadUrl string `yaml:"base_download_url"`
	GitUser         string `yaml:"git_user"`
	GitRepo         string `yaml:"git_repo"`
	GiteaURL        string `yaml:"gitea_url"`
	SourceUrl       string `yaml:"source_url"`

	FilenameFormat   string `yaml:"filename_format"`
	VersionFormat    string `yaml:"version_format"`
	LatestStrategy   string `yaml:"latest_strategy"`
	ForceLatest      bool   `yaml:"force_latest"`
	AllowPrerelease  bool   `yaml:"allow_prerelease"`
	ArchLinuxPkgName string `yaml:"arch_linux_pkg_name"`

	OsMap   map[string]OsInfo `yaml:"os_map"`
	ArchMap map[string]string `yaml:"arch_map"`
	Ignore  []OsArchPair      `yaml:"ignore"`
}

func ParsePkgConfigLocal

func ParsePkgConfigLocal(pkgRepos []*config.PkgRepo, pkg string) (*PkgConfig, error)

func (*PkgConfig) GetAssetStemExtUrl

func (pkgConf *PkgConfig) GetAssetStemExtUrl(version string) (*string, *string, *string, error)

/

func (*PkgConfig) GetLatestVersion

func (pkgConf *PkgConfig) GetLatestVersion() (*string, error)

func (*PkgConfig) GetMyBinPaths

func (pkgConf *PkgConfig) GetMyBinPaths() ([]string, error)

func (*PkgConfig) GetRenames added in v0.9.0

func (pkgConf *PkgConfig) GetRenames() ([]RenameItem, error)

type PkgGroupConfig

type PkgGroupConfig struct {
	Title   string
	Tagline string
	About   string

	InfoUrl  string   `yaml:"info_url"`
	Packages []string `yaml:"packages"`
}

func ParseGroupConfig

func ParseGroupConfig(group string) *PkgGroupConfig

type PkgInfo

type PkgInfo struct {
	Title   string
	Tagline string
	About   string
}

func ParseMultiPkgInfo

func ParseMultiPkgInfo(pkgs []string) ([]PkgInfo, error)

func ParsePkgInfo

func ParsePkgInfo(pkgRepo, pkg string) (*PkgInfo, error)

type ReleaseInfo

type ReleaseInfo struct {
	Url     string
	Assets  []AssetInfo
	TagName string `json:"tag_name"`
	Date    string `json:"published_at"`
}

type ReleaseTagInfo

type ReleaseTagInfo struct {
	TagName    string `json:"tag_name"`
	Date       string `json:"published_at"`
	Prerelease bool
	Draft      bool
}

type RenameItem added in v0.9.0

type RenameItem struct {
	From string `yaml:"from"`
	To   string `yaml:"to"`
}

type SingleOrMulti

type SingleOrMulti struct {
	Values []string
}

func (*SingleOrMulti) UnmarshalYAML

func (sm *SingleOrMulti) UnmarshalYAML(unmarshal func(interface{}) error) error

type UsingInfo

type UsingInfo struct {
	Using string
}

Jump to

Keyboard shortcuts

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