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") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Packages []Package `yaml:"packages" json:"packages"`
}
func CheckConfig ¶
CheckConfig parses the YAML configuration from the specified path or ".gochecker.yaml" by default.
func (*Config) LoadVersions ¶
func (*Config) SaveVersions ¶
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 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 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 ¶
Click to show internal directories.
Click to hide internal directories.