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)
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)
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.
Click to show internal directories.
Click to hide internal directories.