Documentation ¶
Index ¶
- type ArtifactInfo
- type ArtifactRegistryClientWrapper
- func (w *ArtifactRegistryClientWrapper) GetRepository(ctx context.Context, req *artifactregistrypb.GetRepositoryRequest, ...) (*artifactregistrypb.Repository, error)
- func (w *ArtifactRegistryClientWrapper) ListDockerImages(ctx context.Context, req *artifactregistrypb.ListDockerImagesRequest, ...) models.GenericIterator[artifactregistrypb.DockerImage]
- func (w *ArtifactRegistryClientWrapper) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) models.GenericIterator[locationpb.Location]
- func (w *ArtifactRegistryClientWrapper) ListRepositories(ctx context.Context, req *artifactregistrypb.ListRepositoriesRequest, ...) models.GenericIterator[artifactregistrypb.Repository]
- type ArtifactRegistryService
- func (ars *ArtifactRegistryService) Artifacts(projectID string, location string, repositoryName string) ([]ArtifactInfo, error)
- func (ars *ArtifactRegistryService) DockerImages(repositoryName string) ([]ArtifactInfo, error)
- func (ars *ArtifactRegistryService) Repositories(projectID string) ([]RepositoryInfo, error)
- func (ars *ArtifactRegistryService) RepositoriesAndArtifacts(projectID string) (CombinedRepoArtifactInfo, error)
- type CombinedRepoArtifactInfo
- type DockerImageDetails
- type RepositoryInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactInfo ¶
type ArtifactInfo struct { Name string `json:"name"` Format string `json:"format"` Version string `json:"version"` Location string `json:"location"` Repository string `json:"repository"` SizeBytes string `json:"virtualSize"` Updated string `json:"updated"` Digest string `json:"digest"` ProjectID string `json:"projectID"` }
ArtifactInfo represents the basic information of an artifact within a registry.
type ArtifactRegistryClientWrapper ¶
type ArtifactRegistryClientWrapper struct { Closer func() error RepositoryLister func(ctx context.Context, req *artifactregistrypb.ListRepositoriesRequest, opts ...gax.CallOption) models.GenericIterator[artifactregistrypb.Repository] LocationLister func(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) models.GenericIterator[locationpb.Location] RepositoryGetter func(ctx context.Context, req *artifactregistrypb.GetRepositoryRequest, opts ...gax.CallOption) (*artifactregistrypb.Repository, error) DockerImageLister func(ctx context.Context, req *artifactregistrypb.ListDockerImagesRequest, opts ...gax.CallOption) models.GenericIterator[artifactregistrypb.DockerImage] }
Function calls to the API are wrapped to facilitate mocking
func (*ArtifactRegistryClientWrapper) GetRepository ¶
func (w *ArtifactRegistryClientWrapper) GetRepository(ctx context.Context, req *artifactregistrypb.GetRepositoryRequest, opts ...gax.CallOption) (*artifactregistrypb.Repository, error)
func (*ArtifactRegistryClientWrapper) ListDockerImages ¶
func (w *ArtifactRegistryClientWrapper) ListDockerImages(ctx context.Context, req *artifactregistrypb.ListDockerImagesRequest, opts ...gax.CallOption) models.GenericIterator[artifactregistrypb.DockerImage]
func (*ArtifactRegistryClientWrapper) ListLocations ¶
func (w *ArtifactRegistryClientWrapper) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) models.GenericIterator[locationpb.Location]
func (*ArtifactRegistryClientWrapper) ListRepositories ¶
func (w *ArtifactRegistryClientWrapper) ListRepositories(ctx context.Context, req *artifactregistrypb.ListRepositoriesRequest, opts ...gax.CallOption) models.GenericIterator[artifactregistrypb.Repository]
type ArtifactRegistryService ¶
type ArtifactRegistryService struct {
Client *ArtifactRegistryClientWrapper
}
ArtifactRegistryService provides methods to interact with Artifact Registry resources.
func New ¶
func New(client *artifactregistry.Client) ArtifactRegistryService
New creates a new instance of the ArtifactRegistryService using an artifactregistry.Client
func (*ArtifactRegistryService) Artifacts ¶
func (ars *ArtifactRegistryService) Artifacts(projectID string, location string, repositoryName string) ([]ArtifactInfo, error)
Artifacts fetches the artifacts for a given repository, handling different formats.
func (*ArtifactRegistryService) DockerImages ¶
func (ars *ArtifactRegistryService) DockerImages(repositoryName string) ([]ArtifactInfo, error)
listDockerImages specifically lists Docker images within a given repository.
func (*ArtifactRegistryService) Repositories ¶
func (ars *ArtifactRegistryService) Repositories(projectID string) ([]RepositoryInfo, error)
RepositoriesAndArtifacts returns a list of repositories and artifacts given projectID. TODO consider putting location as input, so that we can put Locations iteration before it & potentially filter by location at top level of GCP module
func (*ArtifactRegistryService) RepositoriesAndArtifacts ¶
func (ars *ArtifactRegistryService) RepositoriesAndArtifacts(projectID string) (CombinedRepoArtifactInfo, error)
RepositoriesAndArtifacts retrieves both repositories and their artifacts for a given projectID.
type CombinedRepoArtifactInfo ¶
type CombinedRepoArtifactInfo struct { Repositories []RepositoryInfo `json:"repositories"` Artifacts []ArtifactInfo `json:"artifacts"` }
CombinedRepoArtifactInfo holds the combined information of repositories and their respective artifacts.
type DockerImageDetails ¶
type DockerImageDetails struct { ProjectID string `json:"projectID"` Location string `json:"location"` Repository string `json:"repository"` ImageName string `json:"name"` Digest string `json:"digest"` }
DockerImageDetails holds the extracted parts from a Docker image name.
type RepositoryInfo ¶
type RepositoryInfo struct { Name string `json:"name"` Format string `json:"format"` Description string `json:"description"` SizeBytes string `json:"sizeBytes"` ProjectID string `json:"projectID"` Location string `json:"location"` }
RepositoryInfo holds information about a repository and its artifacts.