Documentation
¶
Index ¶
- Constants
- func CompareVersions(left, right string) (int, error)
- func DefaultCachePath() (string, error)
- func ErrorRetryable(kind ErrorKind) bool
- func NormalizeVersion(raw string) (string, error)
- func RunInternalUpdate([]string) error
- func WrapError(kind ErrorKind, err error) error
- type Artifact
- type AutoCheckOptions
- type AutoCheckResult
- type Client
- func (client *Client) DownloadArtifact(ctx context.Context, version, goos, goarch string) (Artifact, error)
- func (client *Client) LatestVersion(ctx context.Context) (string, error)
- func (client *Client) ResolveLatestVersion(ctx context.Context) (string, error)
- func (client *Client) ValidateArtifact(ctx context.Context, version, goos, goarch string) (string, error)
- type CommandRunner
- type ErrorKind
- type Options
- type Result
Constants ¶
View Source
const (
DefaultOSSBaseURL = "https://ros-public-tools.oss-cn-beijing.aliyuncs.com/github-releases/aliyun/elastic-compute-control-cli"
)
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶
func DefaultCachePath ¶
func ErrorRetryable ¶
func NormalizeVersion ¶
func RunInternalUpdate ¶
Types ¶
type AutoCheckOptions ¶
type AutoCheckResult ¶
func AutoCheck ¶
func AutoCheck(ctx context.Context, options AutoCheckOptions) (AutoCheckResult, error)
type Client ¶
type Client struct {
HTTP *http.Client
OSSBase string
GitHubAPIBase string
// contains filtered or unexported fields
}
func (*Client) DownloadArtifact ¶
func (*Client) LatestVersion ¶
func (*Client) ResolveLatestVersion ¶
ResolveLatestVersion resolves the mutable OSS pointer through a signed v2 manifest. GitHub remains a compatibility fallback when OSS is unavailable.
func (*Client) ValidateArtifact ¶
func (client *Client) ValidateArtifact(ctx context.Context, version, goos, goarch string) (string, error)
ValidateArtifact verifies that a platform artifact is published and returns the source an update would use without downloading the archive itself. A v2 release is bound by its signed v2 manifest; legacy releases are bound by immutable GitHub Release digests.
type CommandRunner ¶
type Result ¶
type Result struct {
CurrentVersion string `json:"current_version"`
TargetVersion string `json:"target_version"`
UpdateAvailable bool `json:"update_available"`
Source string `json:"source"`
Installer string `json:"installer"`
Updated bool `json:"updated"`
UpdatePending bool `json:"update_pending"`
}
Click to show internal directories.
Click to hide internal directories.