registry

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GoogleContainerRegistry = "gcr"
)

Variables

View Source
var (
	RegistryMapper = map[string]registryGen{
		GoogleContainerRegistry: NewGCR,
	}
	TokenSourceMapper = map[string]oauthTokenSource{
		GoogleContainerRegistry: gcrOauthSource,
	}
)

Functions

func GetImageRegistryByHostname

func GetImageRegistryByHostname(host string) (string, error)

Types

type Digest

type Digest struct {
	ImageSizeBytes uint      `json:"size"`
	Tag            []string  `json:"tags"`
	Created        time.Time `json:"created"`
	Uploaded       time.Time `json:""`
	Name           string    `json:"digest"`
}

type ErrorField

type ErrorField struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type ErrorsField

type ErrorsField struct {
	Errors []ErrorField `json:"errors"`
}

type GCR

type GCR struct {
	// contains filtered or unexported fields
}

func (GCR) Catalog

func (g GCR) Catalog() ([]Repository, error)

Catalog list of repositorry, recursively follow child attribute instead using image registry API spec so we can only use less permission in service account

func (GCR) Delete

func (g GCR) Delete(repository Repository) (err error)

type GCRDigest

type GCRDigest struct {
	ImageSizeBytes string   `json:"imageSizeBytes"`
	LayerID        string   `json:"layerId"`
	MediaType      string   `json:"mediaType"`
	Tag            []string `json:"tag"`
	TimeCreatedMs  string   `json:"timeCreatedMs"`
	TimeUploadedMs string   `json:"timeUploadedMs"`
	Name           string
}

type GCRTagsResponse

type GCRTagsResponse struct {
	Child    []string             `json:"child"`
	Manifest map[string]GCRDigest `json:"manifest"`
	Name     string               `json:"name"`
	Tags     []string             `json:"tags"`
	ErrorsField
}

type ImageRegistry

type ImageRegistry interface {
	Catalog() ([]Repository, error)
	Delete(repo Repository) error
}

func NewGCR

func NewGCR(host string, hc http.IHttpClient) (ImageRegistry, error)

type Repository

type Repository struct {
	Name    string   `json:"repository"`
	Digests []Digest `json:"digests"`
}

Directories

Path Synopsis
Package mock_registry is a generated GoMock package.
Package mock_registry is a generated GoMock package.

Jump to

Keyboard shortcuts

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