Documentation
¶
Index ¶
- Constants
- type Catalog
- type CatalogStore
- type InstalledTool
- type LaunchSpec
- type Manager
- func (m *Manager) DefaultUpgradeTools() ([]Tool, error)
- func (m *Manager) PrepareUpdateCheck(resolution Resolution) UpdateCheckPlan
- func (m *Manager) RefreshUpdateCheck(tool Tool, current string) error
- func (m *Manager) Resolve(tool Tool) (Resolution, error)
- func (m *Manager) Upgrade(tools []Tool) (UpgradeResult, error)
- type Manifest
- type ManifestAsset
- type ManifestTool
- type Resolution
- type SkillSpec
- type Snapshot
- type Source
- type State
- type Status
- type Tool
- type ToolSpec
- type UpdateCheckPlan
- type UpdateCheckResult
- type UpgradeItem
- type UpgradeResult
Constants ¶
const ( DefaultManifestURL = "https://cloudcache.volccdn.com/ve/proxycli/manifest.json" EnvProxyPath = "VOLCENGINE_CLI_PROXY_PATH" StateFileName = "install-state.json" )
const CatalogFileName = "catalog-v2.json"
const CatalogSchemaVersion = 2
const DefaultCatalogURL = "https://cloudcache.volccdn.com/ve/proxycli/catalog-v2.json"
const InstallerProtocolVersion = 3
const SkillsRepository = "https://github.com/volcengine/volcengine-skills"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶ added in v1.1.11
type Catalog struct {
SchemaVersion int `json:"schema_version"`
Revision string `json:"catalog_revision"`
MinInstallerProtocol int `json:"min_installer_protocol"`
Tools []ToolSpec `json:"tools"`
}
Catalog is the versioned publication contract. Snapshot owns a private copy.
type CatalogStore ¶ added in v1.1.11
type CatalogStore struct{ Dir string }
func NewCatalogStore ¶ added in v1.1.11
func NewCatalogStore() (*CatalogStore, error)
func (*CatalogStore) Load ¶ added in v1.1.11
func (s *CatalogStore) Load() *Snapshot
Load is local-only and does not create directories or read business credentials. A malformed cache falls back to the previous valid cache, then the embedded data.
func (*CatalogStore) Refresh ¶ added in v1.1.11
func (s *CatalogStore) Refresh() (*Snapshot, error)
func (*CatalogStore) RefreshFile ¶ added in v1.1.11
func (s *CatalogStore) RefreshFile(path string) (*Snapshot, error)
RefreshFile explicitly imports a reviewed local catalog. It uses exactly the production schema/URL checks, with no arbitrary download hosts or scripts.
type InstalledTool ¶
type LaunchSpec ¶ added in v1.1.11
type LaunchSpec struct {
Kind string `json:"kind"`
}
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
Catalog *Snapshot
// contains filtered or unexported fields
}
func NewManager ¶
func NewManagerWithCatalog ¶ added in v1.1.11
func (*Manager) DefaultUpgradeTools ¶ added in v1.1.11
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 ¶
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.
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"`
}
ManifestAsset is deliberately identical for every product. Installation uses the built-in native ZIP convention (Ark retains its legacy raw format).
type ManifestTool ¶
type ManifestTool struct {
Version string `json:"version"`
Platforms map[string]ManifestAsset `json:"platforms"`
}
type Resolution ¶
type Snapshot ¶ added in v1.1.11
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot is immutable; returned specifications are deep copies.
func EmbeddedSnapshot ¶ added in v1.1.11
func EmbeddedSnapshot() *Snapshot
func ParseCatalog ¶ added in v1.1.11
ParseCatalog validates publication data, never executes or probes a tool.
func ReadCatalogFile ¶ added in v1.1.11
ReadCatalogFile validates a bounded local publication without changing cache.
type State ¶
type State struct {
Tools map[Tool]*InstalledTool `json:"tools"`
}
type Tool ¶
type Tool string
func LegacyTools ¶ added in v1.1.11
func LegacyTools() []Tool
LegacyTools is the historical default install set, not catalog enumeration.
type ToolSpec ¶ added in v1.1.11
type ToolSpec struct {
ID Tool `json:"id"`
Command string `json:"command"`
Aliases []string `json:"aliases"`
Description string `json:"description"`
Readiness string `json:"readiness"`
ReleaseVersion string `json:"release_version,omitempty"`
Executable string `json:"executable"`
Launch LaunchSpec `json:"launch"`
SourceURL string `json:"source_url"`
Platforms map[string]ManifestAsset `json:"platforms"`
Skills SkillSpec `json:"skills"`
Notes []string `json:"notes,omitempty"`
Gaps []string `json:"gaps,omitempty"`
PathPolicy string `json:"path_policy"` // prefer or managed-only
}
type UpdateCheckPlan ¶
type UpdateCheckPlan struct {
Refresh bool
HasNotice bool
Notice UpdateCheckResult
}
type UpdateCheckResult ¶
type UpgradeItem ¶
type UpgradeResult ¶
type UpgradeResult struct {
Items []UpgradeItem
}