proxycli

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultManifestURL = "https://cloudcache.volccdn.com/ve/proxycli/manifest.json"

	EnvProxyPath  = "VOLCENGINE_CLI_PROXY_PATH"
	StateFileName = "install-state.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InstalledTool

type InstalledTool struct {
	Version        string `json:"version"`
	ArtifactSHA256 string `json:"artifactSha256"`
	BinarySHA256   string `json:"binarySha256"`
	Path           string `json:"path"`
	Source         Source `json:"source"`
	UpdatedAt      string `json:"updatedAt"`
}

type Manager

type Manager struct {
	HomeDir          string
	ConfigDir        string
	BinDir           string
	ManifestURL      string
	FallbackManifest []byte
	HTTPClient       *http.Client
	CheckHTTPClient  *http.Client
	LookPath         func(string) (string, error)
	GOOS             string
	GOARCH           string
	Now              func() time.Time
	// contains filtered or unexported fields
}

func NewManager

func NewManager() (*Manager, error)

func (*Manager) PrepareUpdateCheck

func (m *Manager) PrepareUpdateCheck(resolution Resolution) UpdateCheckPlan

PrepareUpdateCheck performs only local work before process delegation. A stale cache is synchronously marked with a failure-backoff lease so an exec of a short-lived child cannot cause every invocation to launch another CDN request. The caller starts an independent helper when Refresh is true.

func (*Manager) RefreshUpdateCheck

func (m *Manager) RefreshUpdateCheck(tool Tool, current string) error

RefreshUpdateCheck is run by the detached helper. It performs the remote probe and replaces the synchronous lease with a success or failure cache entry while preserving the daily notice throttle.

func (*Manager) Resolve

func (m *Manager) Resolve(tool Tool) (Resolution, error)

Resolve applies the fixed lookup order: the user's PATH first, followed by the ve-managed proxy CLI directory. A missing managed binary is installed lazily from the independent proxy CLI manifest.

func (*Manager) Upgrade

func (m *Manager) Upgrade(tools []Tool) (UpgradeResult, error)

Upgrade installs or upgrades ve-managed proxy CLIs. Binaries found first on PATH are deliberately left to their original package manager.

type Manifest

type Manifest struct {
	Tools map[Tool]ManifestTool `json:"tools"`
}

type ManifestAsset

type ManifestAsset struct {
	URL    string `json:"url"`
	SHA256 string `json:"sha256"`
	Size   int64  `json:"size,omitempty"`
}

type ManifestTool

type ManifestTool struct {
	Version   string                   `json:"version"`
	Platforms map[string]ManifestAsset `json:"platforms"`
}

type Resolution

type Resolution struct {
	Tool    Tool
	Path    string
	Version string
	Source  Source
}

type Source

type Source string
const (
	SourcePath     Source = "path"
	SourceManaged  Source = "managed"
	SourceCDN      Source = "cdn"
	SourceEmbedded Source = "embedded-fallback"
)

type State

type State struct {
	Tools map[Tool]*InstalledTool `json:"tools"`
}

type Status

type Status string
const (
	StatusExternal  Status = "externally-managed"
	StatusInstalled Status = "installed"
	StatusUpdated   Status = "updated"
	StatusRestored  Status = "restored"
	StatusCurrent   Status = "current"
)

type Tool

type Tool string
const (
	ToolArkCLI  Tool = "arkcli"
	ToolTOSUtil Tool = "tosutil"
)

func KnownTools

func KnownTools() []Tool

func ParseTool

func ParseTool(value string) (Tool, error)

type UpdateCheckPlan

type UpdateCheckPlan struct {
	Refresh   bool
	HasNotice bool
	Notice    UpdateCheckResult
}

type UpdateCheckResult

type UpdateCheckResult struct {
	Tool      Tool
	Current   string
	Latest    string
	HasUpdate bool
}

type UpgradeItem

type UpgradeItem struct {
	Tool    Tool
	Status  Status
	Version string
	Path    string
	Source  Source
}

type UpgradeResult

type UpgradeResult struct {
	Items []UpgradeItem
}

Jump to

Keyboard shortcuts

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