Documentation ¶
Overview ¶
* Copyright 2023 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Constants
- func DockerTearDown(dlr DockerLocalRegistry)
- func GetCustomDockerConnectionWithIP(ip string) (*client.Client, error)
- func GetDockerConnection() (*client.Client, error)
- func GetRegistryConnection(url string, username string, password string) (*registryContainer.Registry, error)
- func GetRootPodmanConnection() (context.Context, error)
- func GetRootlessPodmanConnection() (context.Context, error)
- func IsPortAvailable(port string) bool
- func PodmanTearDown(plr PodmanLocalRegistry)
- func SetupDockerSocket() (DockerLocalRegistry, string, Docker)
- func SetupPodmanSocket() (PodmanLocalRegistry, string, Podman)
- type Docker
- func (d Docker) ContainerKill(containerID string) error
- func (d Docker) ContainerRemove(containerID string) error
- func (d Docker) ContainerStop(containerID string) error
- func (d Docker) GetClient() (*client.Client, error)
- func (d Docker) GetClientRemote(host string, cacertPath string, certPath string, keyPath string) (*client.Client, error)
- func (d Docker) GetClientRemoteFromEnv(host string) (*client.Client, error)
- func (d Docker) GetContainerID(imageName string) (string, error)
- func (d Docker) GetImages(args types.ImageListOptions) ([]types.ImageSummary, error)
- func (d Docker) PullImage(image string) error
- func (d Docker) PurgeContainer(id string, image string) (bool, error)
- func (d Docker) PurgeImages() (bool, error)
- func (d Docker) PushImage(image string, url string, username string, password string) error
- func (d Docker) RemoveDanglingImages() (bool, error)
- func (d Docker) RemoveImagesFiltered(repo string, tag string) (bool, error)
- func (d Docker) RemoveImagesUntagged() (bool, error)
- func (d Docker) TagImage(imageSource string, imageTag string) error
- type DockerLocalRegistry
- func (d DockerLocalRegistry) GetRegistryRunningID() string
- func (d DockerLocalRegistry) IsImagePresent(name string) bool
- func (d DockerLocalRegistry) IsRegistryImagePresent() bool
- func (d DockerLocalRegistry) StartRegistry() string
- func (d DockerLocalRegistry) StopAndRemoveContainer(containerID string) bool
- func (d DockerLocalRegistry) StopRegistry() bool
- type Podman
- func (p Podman) ContainerKill(containerID string) error
- func (p Podman) ContainerRemove(containerID string) error
- func (p Podman) ContainerStop(containerID string) error
- func (p Podman) ExistsImage(term string) (bool, error)
- func (p Podman) GetContainerID(imageName string) (string, error)
- func (p Podman) GetImages(options *images.ListOptions) []*entities.ImageSummary
- func (p Podman) GetImagesWithOptions(options images.ListOptions) []*entities.ImageSummary
- func (p Podman) GetRemoteConnection(uri string, identity string) (context.Context, error)
- func (p Podman) PruneContainers() (bool, error)
- func (p Podman) PruneImages() (bool, error)
- func (p Podman) PullImage(image string) ([]string, error)
- func (p Podman) PurgeContainer(id string, image string) (bool, error)
- func (p Podman) PurgeImages() (bool, error)
- func (p Podman) PushImage(image string, url string, username string, password string) error
- func (p Podman) RemoveDanglingImages() (bool, error)
- func (p Podman) RemoveImage(name string, force bool) (*entities.ImageRemoveReport, []error)
- func (p Podman) RemoveImagesFiltered(repo string, tag string) (bool, error)
- func (p Podman) RemoveImagesUntagged() (bool, error)
- func (p Podman) SearchImagesWithName(term string) ([]entities.ImageSearchReport, error)
- func (p Podman) TagImage(nameOrId string, tag string, repo string) error
- type PodmanLocalRegistry
- func (p PodmanLocalRegistry) GetRegistryRunningID() string
- func (p PodmanLocalRegistry) IsRegistryImagePresent() bool
- func (p PodmanLocalRegistry) IsRegistryRunning() bool
- func (p PodmanLocalRegistry) RemoveRegistryContainerAndImage()
- func (p PodmanLocalRegistry) StartRegistry() string
- func (p PodmanLocalRegistry) StopAndRemoveContainer(containerID string) bool
- func (p PodmanLocalRegistry) StopRegistry() bool
- type Registry
- type RegistryContainer
- func (r RegistryContainer) DeleteImage(repository string, tag string) error
- func (r RegistryContainer) DeleteImageByDigest(repository string, digest digest.Digest) error
- func (r RegistryContainer) DeleteManifest(repo string, tag string) error
- func (r RegistryContainer) GetRepositories() ([]string, error)
- func (r RegistryContainer) GetRepositoriesTags(repo string) ([]string, error)
Constants ¶
const LATEST_TAG = "latest"
const REGISTRY_CONTAINER_URL = "http://localhost:5000"
const REGISTRY_CONTAINER_URL_FROM_DOCKER_SOCKET = "tcp://localhost:5000"
const REGISTRY_IMG = "registry"
const REGISTRY_IMG_FULL = "docker.io/library/registry"
const REGISTRY_IMG_FULL_TAG = "docker.io/library/registry:latest"
const TEST_IMG = "busybox"
const TEST_IMG_LOCAL_TAG = "localhost:5000/busybox:latest"
const TEST_IMG_SECOND = "alpine"
const TEST_IMG_SECOND_LOCAL_TAG = "localhost:5000/alpine:latest"
const TEST_IMG_SECOND_TAG = "alpine:latest"
const TEST_IMG_TAG = "busybox:latest"
const TEST_REGISTRY_REPO = "localhost:5000/"
const TEST_REPO = "docker.io/library/"
Variables ¶
This section is empty.
Functions ¶
func DockerTearDown ¶
func DockerTearDown(dlr DockerLocalRegistry)
func GetDockerConnection ¶
func GetRegistryConnection ¶
func GetRootPodmanConnection ¶
func IsPortAvailable ¶
func PodmanTearDown ¶
func PodmanTearDown(plr PodmanLocalRegistry)
func SetupDockerSocket ¶
func SetupDockerSocket() (DockerLocalRegistry, string, Docker)
func SetupPodmanSocket ¶
func SetupPodmanSocket() (PodmanLocalRegistry, string, Podman)
Types ¶
type Docker ¶
func (Docker) ContainerKill ¶
func (Docker) ContainerRemove ¶
func (Docker) ContainerStop ¶
func (Docker) GetClientRemote ¶
func (Docker) GetClientRemoteFromEnv ¶
func (Docker) GetImages ¶
func (d Docker) GetImages(args types.ImageListOptions) ([]types.ImageSummary, error)
func (Docker) PurgeContainer ¶
func (Docker) PurgeImages ¶
Purge images with dangling true
func (Docker) RemoveDanglingImages ¶
RemoveDanglingImages removes the images with the filter dangling true
func (Docker) RemoveImagesFiltered ¶
remove all the images found using the repo name, with or without tag
func (Docker) RemoveImagesUntagged ¶
RemoveImagesUntagged removes the images with tag <none>:<none>
type DockerLocalRegistry ¶
func GetCustomRegistry ¶
func GetCustomRegistry() (DockerLocalRegistry, *client.Client, error)
func (DockerLocalRegistry) GetRegistryRunningID ¶
func (d DockerLocalRegistry) GetRegistryRunningID() string
func (DockerLocalRegistry) IsImagePresent ¶
func (d DockerLocalRegistry) IsImagePresent(name string) bool
func (DockerLocalRegistry) IsRegistryImagePresent ¶
func (d DockerLocalRegistry) IsRegistryImagePresent() bool
func (DockerLocalRegistry) StartRegistry ¶
func (d DockerLocalRegistry) StartRegistry() string
func (DockerLocalRegistry) StopAndRemoveContainer ¶
func (d DockerLocalRegistry) StopAndRemoveContainer(containerID string) bool
func (DockerLocalRegistry) StopRegistry ¶
func (d DockerLocalRegistry) StopRegistry() bool
type Podman ¶
func (Podman) ContainerKill ¶
func (Podman) ContainerRemove ¶
func (Podman) ContainerStop ¶
func (Podman) GetImages ¶
func (p Podman) GetImages(options *images.ListOptions) []*entities.ImageSummary
func (Podman) GetImagesWithOptions ¶
func (p Podman) GetImagesWithOptions(options images.ListOptions) []*entities.ImageSummary
func (Podman) GetRemoteConnection ¶
func (Podman) PruneContainers ¶
func (Podman) PruneImages ¶
func (Podman) PurgeContainer ¶
func (Podman) PurgeImages ¶
func (Podman) RemoveDanglingImages ¶
func (Podman) RemoveImage ¶
func (Podman) RemoveImagesFiltered ¶
func (Podman) RemoveImagesUntagged ¶
func (Podman) SearchImagesWithName ¶
func (p Podman) SearchImagesWithName(term string) ([]entities.ImageSearchReport, error)
type PodmanLocalRegistry ¶
func (PodmanLocalRegistry) GetRegistryRunningID ¶
func (p PodmanLocalRegistry) GetRegistryRunningID() string
func (PodmanLocalRegistry) IsRegistryImagePresent ¶
func (p PodmanLocalRegistry) IsRegistryImagePresent() bool
func (PodmanLocalRegistry) IsRegistryRunning ¶
func (p PodmanLocalRegistry) IsRegistryRunning() bool
func (PodmanLocalRegistry) RemoveRegistryContainerAndImage ¶
func (p PodmanLocalRegistry) RemoveRegistryContainerAndImage()
func (PodmanLocalRegistry) StartRegistry ¶
func (p PodmanLocalRegistry) StartRegistry() string
func (PodmanLocalRegistry) StopAndRemoveContainer ¶
func (p PodmanLocalRegistry) StopAndRemoveContainer(containerID string) bool
func (PodmanLocalRegistry) StopRegistry ¶
func (p PodmanLocalRegistry) StopRegistry() bool
type RegistryContainer ¶
type RegistryContainer struct { Connection registryContainer.Registry URL string Client *http.Client }
func GetRegistryContainer ¶
func GetRegistryContainer() (RegistryContainer, error)
func (RegistryContainer) DeleteImage ¶
func (r RegistryContainer) DeleteImage(repository string, tag string) error
func (RegistryContainer) DeleteImageByDigest ¶
func (r RegistryContainer) DeleteImageByDigest(repository string, digest digest.Digest) error
func (RegistryContainer) DeleteManifest ¶
func (r RegistryContainer) DeleteManifest(repo string, tag string) error
func (RegistryContainer) GetRepositories ¶
func (r RegistryContainer) GetRepositories() ([]string, error)
func (RegistryContainer) GetRepositoriesTags ¶
func (r RegistryContainer) GetRepositoriesTags(repo string) ([]string, error)