pkgparse

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 18 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"`
	InstallNote            string        `yaml:"install_note"`
	RemoveNote             string        `yaml:"remove_note"`
}

type PkgConfig

type PkgConfig struct {
	Title       string `yaml:"-"`
	Tagline     string `yaml:"tagline"`
	About       string `yaml:"about"`
	InstallNote string `yaml:"install_note"`
	RemoveNote  string `yaml:"remove_note"`

	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 ParsePkgConfig added in v0.9.2

func ParsePkgConfig(name string, r io.Reader) (*PkgConfig, error)

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)

func (*PkgConfig) InstallNotes added in v0.9.1

func (pkgConf *PkgConfig) InstallNotes() string

func (*PkgConfig) RemoveNotes added in v0.9.1

func (pkgConf *PkgConfig) RemoveNotes() string

type PkgGroupConfig

type PkgGroupConfig struct {
	Title   string
	Tagline string
	About   string

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

func ParseGroupConfig

func ParseGroupConfig(r io.Reader, name string) (*PkgGroupConfig, error)

func ParseGroupConfigLocal added in v0.9.2

func ParseGroupConfigLocal(pkgRepos []*config.PkgRepo, group string) (*PkgGroupConfig, string, error)

type PkgInfo

type PkgInfo struct {
	Title       string `yaml:"-"`
	Tagline     string `yaml:"tagline"`
	About       string `yaml:"about"`
	InstallNote string `yaml:"install_note"`
	RemoveNote  string `yaml:"remove_note"`
	OsInfo      map[string]struct {
		InstallNote string `yaml:"install_note"`
		RemoveNote  string `yaml:"remove_note"`
	} `yaml:"os_map"`
}

func ParseMultiPkgInfo

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

func ParsePkgInfo

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

func (*PkgInfo) InstallNotes added in v0.9.2

func (pkgInfo *PkgInfo) InstallNotes() string

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