proxycli

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

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

	EnvProxyPath  = "VOLCENGINE_CLI_PROXY_PATH"
	StateFileName = "install-state.json"
)
View Source
const CatalogFileName = "catalog-v2.json"
View Source
const CatalogSchemaVersion = 2
View Source
const DefaultCatalogURL = "https://cloudcache.volccdn.com/ve/proxycli/catalog-v2.json"
View Source
const InstallerProtocolVersion = 3
View Source
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 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 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 NewManager() (*Manager, error)

func NewManagerWithCatalog added in v1.1.11

func NewManagerWithCatalog(snapshot *Snapshot) (*Manager, error)

func (*Manager) DefaultUpgradeTools added in v1.1.11

func (m *Manager) DefaultUpgradeTools() ([]Tool, 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"`
}

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 Resolution struct {
	Tool        Tool
	Path        string
	Version     string
	Source      Source
	ArgsPrefix  []string
	Environment map[string]string
	TargetPath  string
}

type SkillSpec added in v1.1.11

type SkillSpec struct {
	Repository string   `json:"repository"`
	Names      []string `json:"names"`
}

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

func ParseCatalog(data []byte) (*Snapshot, error)

ParseCatalog validates publication data, never executes or probes a tool.

func ReadCatalogFile added in v1.1.11

func ReadCatalogFile(path string) (*Snapshot, error)

ReadCatalogFile validates a bounded local publication without changing cache.

func (*Snapshot) Catalog added in v1.1.11

func (s *Snapshot) Catalog() Catalog

func (*Snapshot) Lookup added in v1.1.11

func (s *Snapshot) Lookup(value string) (ToolSpec, bool)

func (*Snapshot) ParseTool added in v1.1.11

func (s *Snapshot) ParseTool(value string) (Tool, error)

func (*Snapshot) Ready added in v1.1.11

func (s *Snapshot) Ready(tool Tool) (ToolSpec, error)

func (*Snapshot) Source added in v1.1.11

func (s *Snapshot) Source() string

type Source

type Source string
const (
	SourcePath     Source = "path"
	SourceManaged  Source = "managed"
	SourceCatalog  Source = "catalog"
	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 LegacyTools added in v1.1.11

func LegacyTools() []Tool

LegacyTools is the historical default install set, not catalog enumeration.

func ParseTool

func ParseTool(value string) (Tool, error)

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 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