common

package
v1.44.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const LATEST_TAG = "latest"
View Source
const REGISTRY_CONTAINER_URL = "http://localhost:5000"
View Source
const REGISTRY_CONTAINER_URL_FROM_DOCKER_SOCKET = "tcp://localhost:5000"
View Source
const REGISTRY_IMG = "registry"
View Source
const REGISTRY_IMG_FULL = "docker.io/library/registry"
View Source
const REGISTRY_IMG_FULL_TAG = "docker.io/library/registry:latest"
View Source
const TEST_IMG = "busybox"
View Source
const TEST_IMG_LOCAL_TAG = "localhost:5000/busybox:latest"
View Source
const TEST_IMG_SECOND = "alpine"
View Source
const TEST_IMG_SECOND_LOCAL_TAG = "localhost:5000/alpine:latest"
View Source
const TEST_IMG_SECOND_TAG = "alpine:latest"
View Source
const TEST_IMG_TAG = "busybox:latest"
View Source
const TEST_REGISTRY_REPO = "localhost:5000/"
View Source
const TEST_REPO = "docker.io/library/"

Variables

This section is empty.

Functions

func DockerTearDown

func DockerTearDown(dlr DockerLocalRegistry)

func GetCustomDockerConnectionWithIP

func GetCustomDockerConnectionWithIP(ip string) (*client.Client, error)

func GetDockerConnection

func GetDockerConnection() (*client.Client, error)

func GetRegistryConnection

func GetRegistryConnection(url string, username string, password string) (*registryContainer.Registry, error)

func IsPortAvailable

func IsPortAvailable(port string) bool

func SetupDockerSocket

func SetupDockerSocket() (DockerLocalRegistry, string, Docker)

Types

type Docker

type Docker struct {
	Connection *client.Client
}

func (Docker) ContainerKill

func (d Docker) ContainerKill(containerID string) error

func (Docker) ContainerRemove

func (d Docker) ContainerRemove(containerID string) error

func (Docker) ContainerStop

func (d Docker) ContainerStop(containerID string) error

func (Docker) GetClientRemote

func (d Docker) GetClientRemote(host string, cacertPath string, certPath string, keyPath string) (*client.Client, error)

func (Docker) GetClientRemoteFromEnv

func (d Docker) GetClientRemoteFromEnv(host string) (*client.Client, error)

func (Docker) GetContainerID

func (d Docker) GetContainerID(imageName string) (string, error)

func (Docker) GetImages

func (d Docker) GetImages(args types.ImageListOptions) ([]types.ImageSummary, error)

func (Docker) PullImage

func (d Docker) PullImage(image string) error

func (Docker) PurgeContainer

func (d Docker) PurgeContainer(id string, image string) (bool, error)

func (Docker) PurgeImages

func (d Docker) PurgeImages() (bool, error)

Purge images with dangling true

func (Docker) PushImage

func (d Docker) PushImage(image string, url string, username string, password string) error

func (Docker) RemoveDanglingImages

func (d Docker) RemoveDanglingImages() (bool, error)

RemoveDanglingImages removes the images with the filter dangling true

func (Docker) RemoveImagesFiltered

func (d Docker) RemoveImagesFiltered(repo string, tag string) (bool, error)

remove all the images found using the repo name, with or without tag

func (Docker) RemoveImagesUntagged

func (d Docker) RemoveImagesUntagged() (bool, error)

RemoveImagesUntagged removes the images with tag <none>:<none>

func (Docker) TagImage

func (d Docker) TagImage(imageSource string, imageTag string) error

type DockerLocalRegistry

type DockerLocalRegistry struct {
	Connection *client.Client
}

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 Registry

type Registry interface {
	StartRegistry()
	StopRegistry()
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL