Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolvePkgURL ¶ added in v1.3.43
ResolvePkgURL settles config.Global.Registry.PkgURL for artifact push/pull commands before any bytes are streamed. Precedence:
- explicit --pkg-url flag (normalized via util.GetPkgUrl);
- package URL already configured (saved auth.json login) — left untouched;
- 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
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