Documentation ¶
Index ¶
- func Copy(ctx context.Context, srcClient StorageClient, dstClient StorageClient, ...) (err error)
- func GetCertificates(certFile string) (certificates *x509.CertPool, err error)
- func PullBytes(ctx context.Context, sc StorageClient, artifact Artifact) (data []byte, err error)
- type Artifact
- type Cache
- type CredentialStore
- type OCIRegistryClient
- func (or *OCIRegistryClient) CopyGraph(ctx context.Context, srcStorage orasregistry.Repository, srcRef string, ...) (ocispec.Descriptor, error)
- func (or *OCIRegistryClient) Destination(image Artifact) string
- func (or *OCIRegistryClient) FetchBlob(ctx context.Context, srcStorage orasregistry.Repository, ...) ([]byte, error)
- func (or *OCIRegistryClient) FetchBytes(ctx context.Context, srcStorage orasregistry.Repository, artifact Artifact) (ocispec.Descriptor, []byte, error)
- func (or *OCIRegistryClient) GetHost() string
- func (or *OCIRegistryClient) GetStorage(ctx context.Context, artifact Artifact) (repo orasregistry.Repository, err error)
- func (or *OCIRegistryClient) Init() error
- func (or *OCIRegistryClient) Resolve(ctx context.Context, srcStorage orasregistry.Repository, versionedImage string) (desc ocispec.Descriptor, err error)
- func (or *OCIRegistryClient) SetProject(project string)
- func (or *OCIRegistryClient) Tag(ctx context.Context, dstStorage orasregistry.Repository, ...) error
- type StorageClient
- type StorageContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
func Copy(ctx context.Context, srcClient StorageClient, dstClient StorageClient, image Artifact) (err error)
Copy an image from a source to a destination.
func GetCertificates ¶
GetCertificates get X509 certificates.
Types ¶
type Artifact ¶
Artifact to head release dependency.
func NewArtifact ¶
NewArtifact creates a new artifact object.
func NewArtifactFromURI ¶
NewArtifactFromURI creates a new artifact object from a URI.
func (*Artifact) VersionedImage ¶
VersionedImage returns full URI for image.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache storage client for an OCI registry.
func (*Cache) Get ¶
func (cache *Cache) Get(context StorageContext) (StorageClient, error)
Get cached registry client or make it.
func (*Cache) Set ¶
func (cache *Cache) Set(registryName string, client StorageClient)
Set a client in the cache.
type CredentialStore ¶
type CredentialStore struct {
// contains filtered or unexported fields
}
CredentialStore for registry credentials such as ~/.docker/config.json.
func NewCredentialStore ¶
func NewCredentialStore() *CredentialStore
NewCredentialStore create a credential store.
func (*CredentialStore) Credential ¶
func (cs *CredentialStore) Credential(registry string) (auth.Credential, error)
Credential get an authentication credential for a given registry.
func (*CredentialStore) Init ¶
func (cs *CredentialStore) Init() (err error)
Init initialize a credential store.
func (*CredentialStore) SetDirectory ¶
func (cs *CredentialStore) SetDirectory(directory string)
SetDirectory override default directory.
type OCIRegistryClient ¶
type OCIRegistryClient struct { StorageContext // contains filtered or unexported fields }
OCIRegistryClient storage client for an OCI registry.
func NewOCIRegistry ¶
func NewOCIRegistry(context StorageContext) *OCIRegistryClient
NewOCIRegistry create an OCI registry client.
func (*OCIRegistryClient) CopyGraph ¶
func (or *OCIRegistryClient) CopyGraph(ctx context.Context, srcStorage orasregistry.Repository, srcRef string, dstStorage orasregistry.Repository, dstRef string) (ocispec.Descriptor, error)
CopyGraph copy manifest and all blobs to destination.
func (*OCIRegistryClient) Destination ¶
func (or *OCIRegistryClient) Destination(image Artifact) string
Destination of this storage registry.
func (*OCIRegistryClient) FetchBlob ¶
func (or *OCIRegistryClient) FetchBlob(ctx context.Context, srcStorage orasregistry.Repository, descriptor ocispec.Descriptor) ([]byte, error)
FetchBlob get named blob.
func (*OCIRegistryClient) FetchBytes ¶
func (or *OCIRegistryClient) FetchBytes(ctx context.Context, srcStorage orasregistry.Repository, artifact Artifact) (ocispec.Descriptor, []byte, error)
FetchBytes a resource from the registry.
func (*OCIRegistryClient) GetHost ¶
func (or *OCIRegistryClient) GetHost() string
GetHost for registry host.
func (*OCIRegistryClient) GetStorage ¶
func (or *OCIRegistryClient) GetStorage(ctx context.Context, artifact Artifact) (repo orasregistry.Repository, err error)
GetStorage object based on repository.
func (*OCIRegistryClient) Init ¶
func (or *OCIRegistryClient) Init() error
Init registry configuration.
func (*OCIRegistryClient) Resolve ¶
func (or *OCIRegistryClient) Resolve(ctx context.Context, srcStorage orasregistry.Repository, versionedImage string) (desc ocispec.Descriptor, err error)
Resolve the location of the source repository given the image.
func (*OCIRegistryClient) SetProject ¶
func (or *OCIRegistryClient) SetProject(project string)
SetProject for registry destination.
func (*OCIRegistryClient) Tag ¶ added in v0.14.1
func (or *OCIRegistryClient) Tag(ctx context.Context, dstStorage orasregistry.Repository, desc ocispec.Descriptor, tag string) error
Tag an image.
type StorageClient ¶
type StorageClient interface { Init() error Resolve(ctx context.Context, srcStorage orasregistry.Repository, versionedImage string) (desc ocispec.Descriptor, err error) GetStorage(ctx context.Context, image Artifact) (repo orasregistry.Repository, err error) SetProject(project string) Destination(image Artifact) string FetchBytes(ctx context.Context, srcStorage orasregistry.Repository, artifact Artifact) (ocispec.Descriptor, []byte, error) FetchBlob(ctx context.Context, srcStorage orasregistry.Repository, descriptor ocispec.Descriptor) ([]byte, error) CopyGraph(ctx context.Context, srcStorage orasregistry.Repository, srcRef string, dstStorage orasregistry.Repository, dstRef string) (ocispec.Descriptor, error) Tag(ctx context.Context, dstStorage orasregistry.Repository, desc ocispec.Descriptor, tag string) error }
StorageClient interface for general image storage client.
type StorageContext ¶
type StorageContext struct {
// contains filtered or unexported fields
}
StorageContext describes aspects of a registry.
func NewStorageContext ¶
func NewStorageContext(host string, credentialStore *CredentialStore, certificates *x509.CertPool, insecure bool) StorageContext
NewStorageContext create registry context.