which_registry

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

README

which-registry

Returns which registry from the container image name.

Example

import(
  wr "github.com/ohkinozomu/which-registry"
)

image := "nginx:alpine"
registry, _ := wr.Which(image)

// Docker Hub
fmt.Println(registry)

Supported registries

  • Docker Hub
  • GitHub Container Registry
  • Amazon Elastic Container Registry Public
  • Amazon Elastic Container Registry(private)
  • Google Artifact Registry
  • Google Container Registry
  • Quay.io

License

Apache-2.0

parsers.go was copied from https://github.com/kubernetes/kubernetes.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseImageName

func ParseImageName(image string) (string, string, string, error)

ParseImageName parses a docker image string into three parts: repo, tag and digest. If both tag and digest are empty, a default image tag will be returned.

Types

type Registry

type Registry int
const (
	UNKNOWN Registry = iota
	DOCKER_HUB
	ECR_PUBLIC
	ECR_PRIVATE
	GOOGLE_ARTIFACT_REGISTRY
	GOOGLE_CONTAINER_REGISTRY
	QUAY_IO
	GITHUB_CONTAINER_REGISTRY
)

func Which

func Which(image string) (Registry, error)

func (Registry) String

func (r Registry) String() string

Jump to

Keyboard shortcuts

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