cmdutils

package
v1.3.43 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvePkgURL added in v1.3.43

func ResolvePkgURL(cmd *cobra.Command, pkgURLFlag string) error

ResolvePkgURL settles config.Global.Registry.PkgURL for artifact push/pull commands before any bytes are streamed. Precedence:

  1. explicit --pkg-url flag (normalized via util.GetPkgUrl);
  2. package URL already configured (saved auth.json login) — left untouched;
  3. derived from --api-url via /system/info, the same resolution `hc auth login` performs (see cmd/auth/login.go).

It returns an error when the endpoint is still empty so every push type fails fast instead of streaming bytes into a 404 from a wrong package root.

func ShouldDerivePkgURL added in v1.3.43

func ShouldDerivePkgURL(apiURLFlagSet bool, currentPkgURL string) bool

ShouldDerivePkgURL reports whether the package base URL should be derived from the API base URL via the HAR /system/info endpoint. Derivation only kicks in for the explicit-credential flow: the caller passed --api-url and no package URL is already configured (neither via --pkg-url nor via the saved auth.json login config).

Types

type Factory

type Factory struct {
	// This will be overtaken by main harness-go-sdk client
	RegistryHttpClient   func() *ar.ClientWithResponses
	RegistryV2HttpClient func() *ar_v2.ClientWithResponses
	RegistryV3HttpClient func() *ar_v3.ClientWithResponses
	PkgHttpClient        func() *ar_pkg.ClientWithResponses
}

func NewFactory

func NewFactory() *Factory

func (*Factory) NewRegistryV3HttpClientWithURL added in v1.3.20

func (f *Factory) NewRegistryV3HttpClientWithURL(url string) (*ar_v3.ClientWithResponses, error)

func (*Factory) PkgHttpClientWithProgress added in v1.3.20

func (f *Factory) PkgHttpClientWithProgress(p progress.Reporter, fileSize int64, saveFilename string) *ar_pkg.ClientWithResponses

PkgHttpClientWithProgress creates a package client with retry and progress reporting support

Jump to

Keyboard shortcuts

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