pkg

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_CONFIG_FILE = ".gochecker.yaml"
View Source
const DEFAULT_VERSIONS_FILE = ".gochecker-lock.json"
View Source
const GITHUB_PAT_TOKEN_ENV_VAR = "GITHUB_TOKEN"

Variables

View Source
var (
	ErrInvalidConfig   = errors.New("invalid config")
	ErrUnknownProvider = errors.New("unknown provider")
	ErrConfigNotFound  = errors.New("config file not found")
	ErrConfigRead      = errors.New("failed to read configuration file")
	ErrVersionsRead    = errors.New("failed to read versions file")
	ErrVersionsWrite   = errors.New("failed to write versions file")
	ErrVersionsParse   = errors.New("failed to parse versions file")
)
View Source
var (
	// GitHub provider errors
	ErrGitHubRequest   = errors.New("github request failed")
	ErrGitHubRateLimit = errors.New("github rate limit exceeded")
	ErrGitHubForbidden = errors.New("github access forbidden")
	ErrGitHubStatus    = errors.New("github unexpected status code")
	ErrGitHubDecode    = errors.New("github response decode failed")
)
View Source
var (
	// PyPI provider errors
	ErrPyPIRequest      = errors.New("pypi request failed")
	ErrPyPINotFound     = errors.New("pypi package not found")
	ErrPyPIStatus       = errors.New("pypi unexpected status code")
	ErrPyPIDecode       = errors.New("pypi response decode failed")
	ErrPyPIEmptyVersion = errors.New("pypi returned an empty version")
)
View Source
var (
	// OCI provider errors
	ErrOCIRequest  = errors.New("oci request failed")
	ErrOCINotFound = errors.New("oci image not found")
	ErrOCIDecode   = errors.New("oci response decode failed")
)
View Source
var (
	// AUR provider errors
	ErrAURRequest  = errors.New("aur request failed")
	ErrAURNotFound = errors.New("aur package not found")
	ErrAURDecode   = errors.New("aur response decode failed")
)
View Source
var (
	// Git provider errors
	ErrGitRequest        = errors.New("git remote request failed")
	ErrGitBranchNotFound = errors.New("git branch not found")
	ErrGitNoTags         = errors.New("no tags found in repository")
)

Functions

This section is empty.

Types

type AUR added in v0.0.2

type AUR struct {
	Package string `yaml:"package" json:"package"`
	// Strips the pkgrel. (example: 1.0.2-1 -> 1.0.2)
	StripRelease bool `yaml:"strip_release,omitempty" json:"strip_release,omitempty"`
}

type Config

type Config struct {
	Packages []Package `yaml:"packages" json:"packages"`
}

func CheckConfig

func CheckConfig(path ...string) (*Config, error)

CheckConfig parses the YAML configuration from the specified path or ".gochecker.yaml" by default.

func (*Config) LoadVersions

func (cfg *Config) LoadVersions(path ...string) error

func (*Config) SaveVersions

func (cfg *Config) SaveVersions(path ...string) error

type Git added in v0.0.2

type Git struct {
	URL       string `yaml:"url"                  json:"url"`
	UseCommit bool   `yaml:"use_commit,omitempty" json:"use_commit,omitempty"`
	Branch    string `yaml:"branch,omitempty"     json:"branch,omitempty"`
}

type GitHub

type GitHub struct {
	// Required: "owner/repo"
	Repo string `yaml:"repo" json:"repo"`

	// Optional
	Branch string `yaml:"branch,omitempty" json:"branch,omitempty"`
	Path   string `yaml:"path,omitempty"   json:"path,omitempty"`

	// For GitHub Enterprise (example: github.example.com)
	Host string `yaml:"host,omitempty" json:"host,omitempty"`

	// Release options
	UseLatestRelease  bool `yaml:"use_latest_release,omitempty"  json:"use_latest_release,omitempty"`
	UseMaxRelease     bool `yaml:"use_max_release,omitempty"     json:"use_max_release,omitempty"`
	UseReleaseName    bool `yaml:"use_release_name,omitempty"    json:"use_release_name,omitempty"`
	IncludePrerelease bool `yaml:"include_prereleases,omitempty" json:"include_prereleases,omitempty"`

	// Tag options
	UseLatestTag bool   `yaml:"use_latest_tag,omitempty" json:"use_latest_tag,omitempty"`
	UseMaxTag    bool   `yaml:"use_max_tag,omitempty"    json:"use_max_tag,omitempty"`
	Query        string `yaml:"query,omitempty"          json:"query,omitempty"`
}

type OCI added in v0.0.2

type OCI struct {
	Image string `yaml:"image" json:"image"`
}

type Package

type Package struct {
	Name     string   `yaml:"name"    json:"name"`
	Version  string   `yaml:"version" json:"version"`
	Provider Provider `yaml:",inline" json:",inline"`

	// Global Options
	Prefix string `yaml:"prefix,omitempty" json:"prefix,omitempty"`
}

Package represents a version check target.

type Provider

type Provider struct {
	GitHub *GitHub `yaml:"github,omitempty" json:"github,omitempty"`
	PyPI   *PyPI   `yaml:"pypi,omitempty"   json:"pypi,omitempty"`
	OCI    *OCI    `yaml:"oci,omitempty"    json:"oci,omitempty"`
	AUR    *AUR    `yaml:"aur,omitempty"    json:"aur,omitempty"`
	Git    *Git    `yaml:"git,omitempty"    json:"git,omitempty"`
}

Provider defines which upstream source is used.

type PyPI added in v0.0.2

type PyPI struct {
	Package string `yaml:"package" json:"package"`
}

type Result

type Result struct {
	Name       string `json:"name" yaml:"name"`
	OldVersion string `json:"old_version" yaml:"old_version"`
	NewVersion string `json:"new_version" yaml:"new_version"`
	Updated    bool   `json:"updated" yaml:"updated"`
	Error      error  `json:"-" yaml:"-"`
	ErrorMsg   string `json:"error,omitempty" yaml:"error,omitempty"`
}

type VersionFile

type VersionFile struct {
	Packages map[string]string `json:"packages"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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