Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFactory ¶
func RegisterFactory(t types.RegistryType, factory Factory) error
RegisterFactory registers one adapter factory to the registry.
Types ¶
type Adapter ¶
type Adapter interface {
GetKeyChain(sourcePackageHostname string) (authn.Keychain, error)
GetConfig() types.RegistryConfig
ValidateCredentials() (bool, error)
GetRegistry(ctx context.Context, registry string) (types.RegistryInfo, error)
CreateRegistryIfDoesntExist(registry string) (bool, error)
GetPackages(registry string, artifactType types.ArtifactType, root *types.TreeNode) (
packages []types.Package,
err error,
)
GetVersions(
p types.Package,
node *types.TreeNode,
registry, pkg string,
artifactType types.ArtifactType,
) (versions []types.Version, err error)
GetFiles(registry string) ([]types.File, error)
SearchFiles(registry string) ([]types.SearchedFile, error)
DownloadFile(registry string, uri string) (io.ReadCloser, http.Header, error)
UploadFile(
registry string,
file io.ReadCloser,
f *types.File,
header http.Header,
artifactName string,
version string,
artifactType types.ArtifactType,
metadata map[string]interface{},
) error
GetOCIImagePath(registry string, packageHostname string, image string) (string, error)
AddNPMTag(registry string, name string, version string, uri string) error
VersionExists(
ctx context.Context,
p types.Package,
registryRef, pkg, version string,
artifactType types.ArtifactType,
) (bool, error)
FileExists(
ctx context.Context,
registryRef, pkg, version string,
fileName *types.File,
artifactType types.ArtifactType,
) (bool, error)
// BuildExistingIndex returns a snapshot of everything already present at the
// destination registry (pkg -> version -> files). registryName is the destination
// registry leaf name. Returns (nil, error) on failure; a nil index disables the
// client-side skip so callers just attempt the (idempotent) upload. concurrency
// bounds parallel per-version file fetches.
BuildExistingIndex(
ctx context.Context,
registryName string,
concurrency int,
) (*types.ExistingIndex, error)
CreateVersion(
registry string,
artifactName string,
version string,
artifactType types.ArtifactType,
files []*types.PackageFiles,
metadata map[string]interface{},
) error
}
func GetAdapter ¶
type Factory ¶
type Factory interface {
Create(ctx context.Context, config types.RegistryConfig) (Adapter, error)
}
func GetFactory ¶
func GetFactory(t types.RegistryType) (Factory, error)
GetFactory gets the adapter factory by the specified name.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
command
Command generate-mock-data creates all fixture files (text content and binary packages) in testdata/binary/ so they can be embedded by the mock client at compile time.
|
Command generate-mock-data creates all fixture files (text content and binary packages) in testdata/binary/ so they can be embedded by the mock client at compile time. |
Click to show internal directories.
Click to hide internal directories.