repositories

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HardcodedPackages = []ConfigPackage{
	{
		Path:           "ricardofabila/fox",
		ExecutableName: "fox",
		Type:           "binary",
	},
	{
		Path:           "cli/cli",
		ExecutableName: "gh",
		Type:           "binary",
	},
}

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Name               string `json:"name,omitempty"`
	ID                 int    `json:"id,omitempty"`
	Tag                string `json:"tag_name,omitempty"`
	Size               int    `json:"size,omitempty"` // bytes
	BrowserDownloadURL string `json:"browser_download_url,omitempty"`
}

Asset represents a GitHub release asset in a repository.

func (*Asset) DownloadAsset

func (asset *Asset) DownloadAsset(repo string) error

type Config

type Config struct {
	Remotes  Remotes        `yaml:"remotes"`
	Packages ConfigPackages `yaml:"packages"`
}

type ConfigPackage

type ConfigPackage = struct {
	Path           string   `yaml:"path"`
	ExecutableName string   `yaml:"executableName"`
	Type           string   `yaml:"type"`
	DependsOn      []string `yaml:"dependsOn"`
}

type ConfigPackages

type ConfigPackages = []ConfigPackage

type Package

type Package struct {
	Description     string            `json:"description"`
	Name            string            `json:"name"`
	NameWithOwner   string            `json:"nameWithOwner"`
	UpdatedAt       string            `json:"updatedAt"`
	URL             string            `json:"url"`
	PrimaryLanguage map[string]string `json:"primaryLanguage"`
	// {"primaryLanguage": {
	// 	"name": "Go"
	// },
	// I fetch these separately
	LatestVersion     string
	DependsOn         []string
	ExecutableName    string
	Type              string
	Releases          []Release
	InstalledVersions []string `yaml:"installedVersions"`
	Aliases           []string `yaml:"aliases"`
	Conflicts         string
}

func (*Package) GetReleases

func (p *Package) GetReleases() ([]Release, error)

func (*Package) IsVisible

func (p *Package) IsVisible() bool

func (*Package) SetLatestVersion

func (p *Package) SetLatestVersion(verbose bool) error

type Release

type Release struct {
	Draft      bool `json:"draft,omitempty"`
	Prerelease bool `json:"prerelease,omitempty"`
	// The following fields are not used in CreateRelease or EditRelease:
	ZipballURL string  `json:"zipball_url,omitempty"`
	Tag        string  `json:"tag_name,omitempty"`
	ID         int64   `json:"id,omitempty"`
	Assets     []Asset `json:"assets,omitempty"`
	Name       string  `json:"name,omitempty"`
	Type       string  `json:"type,omitempty"`
	CreatedAt  string  `json:"createdAt,omitempty"`
}

Release represents a GitHub release in a repository.

type Remote

type Remote struct {
	URL  string `yaml:"url"`
	Type string `yaml:"type"`
}

type Remotes

type Remotes = []Remote

Jump to

Keyboard shortcuts

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