Documentation ¶
Index ¶
- Constants
- Variables
- func GetAuthConfig(username, password, registry string) (types.AuthConfig, error)
- func GetRespBody(resp *http.Response) ([]byte, error)
- type Config
- type ContainerConfig
- type DockerConfigEntry
- type DockerConfigJson
- type DockerConfigMap
- type DockerURL
- type History
- type Image
- type ImageBlob
- type ImageDetails
- type ImageManifest
- type Labels
- type Layers
- type ManifestConfig
- type Registry
- func (r *Registry) GetBlobUrl(image Image) string
- func (r *Registry) GetDigestUrl(image Image) string
- func (r *Registry) ImageBlob(image Image, token string) (*ImageBlob, error)
- func (r *Registry) ImageManifest(image Image, token string) (*ImageManifest, error)
- func (r *Registry) Token(url string) (str string, err error)
- type RegistryGetter
- type RegistryOpt
- type Rootfs
Constants ¶
View Source
const ( StatusFailed = "failed" StatusSuccess = "succeeded" )
View Source
const ( // DefaultDockerRegistry is the default docker registry address. DefaultDockerRegistry = "https://registry-1.docker.io" DefaultDockerHub = "docker.io" DefaultTimeout = 30 * time.Second )
Variables ¶
View Source
var ( // ErrBasicAuth indicates that the repository requires basic rather than token authentication. ErrBasicAuth = errors.New("basic auth required") )
Functions ¶
func GetAuthConfig ¶
func GetAuthConfig(username, password, registry string) (types.AuthConfig, error)
GetAuthConfig returns the docker registry AuthConfig.
Types ¶
type Config ¶
type Config struct { HostName string `json:"Hostname,omitempty" description:"A string value containing the hostname to use for the container."` DomainName string `json:"Domainname,omitempty" description:"A string value containing the domain name to use for the container."` User string `json:"User,omitempty" description:"A string value specifying the user inside the container."` AttachStdin bool `json:"AttachStdin,omitempty" description:"Boolean value, attaches to stdin."` AttachStdout bool `json:"AttachStdout,omitempty" description:"Boolean value, attaches to stdout."` AttachStderr bool `json:"AttachStderr,omitempty" description:"Boolean value, attaches to stderr."` ExposedPorts map[string]interface{} `` /* 149-byte string literal not displayed */ Tty bool `json:"Tty,omitempty" description:"Boolean value, Attach standard streams to a tty, including stdin if it is not closed."` OpenStdin bool `json:"OpenStdin,omitempty" description:"Boolean value, opens stdin"` StdinOnce bool `json:"StdinOnce,omitempty" description:"Boolean value, close stdin after the 1 attached client disconnects."` Env []string `json:"Env,omitempty" description:"A list of environment variables in the form of [\"VAR=value\", ...]"` Cmd []string `json:"Cmd,omitempty" description:"Command to run specified as a string or an array of strings."` ArgsEscaped bool `json:"ArgsEscaped,omitempty" description:"Command is already escaped (Windows only)"` Image string `json:"Image,omitempty" description:"A string specifying the image name to use for the container."` Volumes interface{} `json:"Volumes,omitempty" description:"An object mapping mount point paths (strings) inside the container to empty objects."` WorkingDir string `json:"WorkingDir,omitempty" description:"A string specifying the working directory for commands to run in."` Entrypoint interface{} `json:"Entrypoint,omitempty" description:"The entry point set for the container as a string or an array of strings."` OnBuild interface{} `json:"OnBuild,omitempty" description:"ONBUILD metadata that were defined in the image's Dockerfile."` Labels Labels `json:"Labels,omitempty" description:"The map of labels to a container."` StopSignal string `json:"StopSignal,omitempty" description:"Signal to stop a container as a string or unsigned integer."` }
type ContainerConfig ¶
type ContainerConfig struct { HostName string `json:"Hostname,omitempty" description:"A string value containing the hostname to use for the container."` DomainName string `json:"Domainname,omitempty" description:"A string value containing the domain name to use for the container."` User string `json:"User,omitempty" description:"A string value specifying the user inside the container."` AttachStdin bool `json:"AttachStdin,omitempty" description:"Boolean value, attaches to stdin."` AttachStdout bool `json:"AttachStdout,omitempty" description:"Boolean value, attaches to stdout."` AttachStderr bool `json:"AttachStderr,omitempty" description:"Boolean value, attaches to stderr."` ExposedPorts map[string]interface{} `` /* 149-byte string literal not displayed */ Tty bool `json:"Tty,omitempty" description:"Boolean value, Attach standard streams to a tty, including stdin if it is not closed."` OpenStdin bool `json:"OpenStdin,omitempty" description:"Boolean value, opens stdin"` StdinOnce bool `json:"StdinOnce,omitempty" description:"Boolean value, close stdin after the 1 attached client disconnects."` Env []string `json:"Env,omitempty" description:"A list of environment variables in the form of [\"VAR=value\", ...]"` Cmd []string `json:"Cmd,omitempty" description:"Command to run specified as a string or an array of strings."` ArgsEscaped bool `json:"ArgsEscaped,omitempty" description:"Command is already escaped (Windows only)"` Image string `json:"Image,omitempty" description:"A string specifying the image name to use for the container."` Volumes interface{} `json:"Volumes,omitempty" description:"An object mapping mount point paths (strings) inside the container to empty objects."` WorkingDir string `json:"WorkingDir,omitempty" description:"A string specifying the working directory for commands to run in."` EntryPoint interface{} `json:"Entrypoint,omitempty" description:"The entry point set for the container as a string or an array of strings."` OnBuild interface{} `json:"OnBuild,omitempty" description:"ONBUILD metadata that were defined in the image's Dockerfile."` Labels Labels `json:"Labels,omitempty" description:"The map of labels to a container."` StopSignal string `json:"StopSignal,omitempty" description:"Signal to stop a container as a string or unsigned integer."` }
type DockerConfigEntry ¶
type DockerConfigJson ¶
type DockerConfigJson struct {
Auths DockerConfigMap `json:"auths"`
}
type DockerConfigMap ¶
type DockerConfigMap map[string]DockerConfigEntry
DockerConfig represents the config file used by the docker CLI. This config that represents the credentials that should be used when pulling images from specific image repositories.
type Image ¶
type Image struct { Domain string Path string Tag string Digest digest.Digest // contains filtered or unexported fields }
Image holds information about an image.
func ParseImage ¶
ParseImage returns an Image struct with all the values filled in for a given image. example : localhost:5000/nginx:latest, nginx:perl etc.
type ImageBlob ¶
type ImageBlob struct { Architecture string `` /* 128-byte string literal not displayed */ Config Config `json:"config,omitempty" description:"The config field references a configuration object for a container."` Container string `json:"container,omitempty" description:"Container id."` ContainerConfig ContainerConfig `json:"container_config,omitempty" description:"The config data of container."` Created time.Time `json:"created,omitempty" description:"Create time."` DockerVersion string `json:"docker_version,omitempty" description:"docker version."` History []History `json:"history,omitempty" description:"The data of history update."` Os string `json:"os,omitempty" description:"Operating system."` Rootfs Rootfs `json:"rootfs omitempty" description:"Root filesystem."` }
type ImageDetails ¶
type ImageDetails struct { // Status is the status of the image search, such as "failed","succeeded". Status string `json:"status,omitempty" description:"Status is the status of the image search, such as \"succeeded\"."` Message string `json:"message,omitempty" description:"Status message."` ImageManifest *ImageManifest `` /* 159-byte string literal not displayed */ ImageBlob *ImageBlob `` /* 147-byte string literal not displayed */ ImageTag string `json:"imageTag,omitempty" description:"image tag."` Registry string `json:"registry,omitempty" description:"registry domain."` }
ImageBlobInfo describes the info of an image.
type ImageManifest ¶
type ImageManifest struct { SchemaVersion int `json:"schemaVersion,omitempty" description:"This field specifies the image manifest schema version as an integer."` MediaType string `json:"mediaType,omitempty" description:"The MIME type of the manifest."` ManifestConfig ManifestConfig `json:"config,omitempty" description:"The config field references a configuration object for a container."` Layers []Layers `json:"layers,omitempty" description:"Fields of an item in the layers list."` }
type ManifestConfig ¶
type Registry ¶
type Registry struct { URL string Domain string Username string Password string Client *http.Client Opt RegistryOpt }
Registry defines the client for retrieving information from the registry API.
func CreateRegistryClient ¶
func New ¶
func New(auth types.AuthConfig, opt RegistryOpt) (*Registry, error)
New creates a new Registry struct with the given URL and credentials.
func (*Registry) GetBlobUrl ¶
func (*Registry) GetDigestUrl ¶
func (*Registry) ImageManifest ¶
func (r *Registry) ImageManifest(image Image, token string) (*ImageManifest, error)
Digest returns the digest for an image.
type RegistryGetter ¶
type RegistryGetter interface { VerifyRegistryCredential(credential api.RegistryCredential) error GetEntry(namespace, secretName, imageName string, insecure bool) (ImageDetails, error) }
func NewRegistryGetter ¶
func NewRegistryGetter(informers informers.SharedInformerFactory) RegistryGetter
Source Files ¶
Click to show internal directories.
Click to hide internal directories.