registry

package
v0.0.0-...-2ae20b0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CacheDefaultTTL             = 15 * time.Minute
	CacheDefaultCleanupInterval = 5 * time.Minute
	ResovleImageDefaultTimeout  = 3 * time.Minute
	ResolveTagsDefaultTimeout   = 1 * time.Minute
)

Functions

func ExecuteRequest

func ExecuteRequest(ctx context.Context, client *http.Client, method string, url string, result interface{}) error

ExecuteRequest executes an HTTP request for <method> and <url> using <client> and returns the decoded response in <result> (which therefore should be a pointer to a struct type with json tags) Opinionated and expects a JSON response

func NewRegistryClient

func NewRegistryClient(registry name.Registry, keychain authn.Keychain, scopes ...string) (*http.Client, error)

NewRegistryClient is a wrapper for creating a customized http.Client based on go-containerregistry abstractions

Types

type DockerHubRegistry

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

func (*DockerHubRegistry) Keychain

func (d *DockerHubRegistry) Keychain() authn.Keychain

func (*DockerHubRegistry) ResolveImages

func (d *DockerHubRegistry) ResolveImages(ctx context.Context, directory string) ([]string, error)

func (*DockerHubRegistry) ResolveTagDetails

func (d *DockerHubRegistry) ResolveTagDetails(ctx context.Context, tag *TagDetails) (*TagDetails, error)

func (*DockerHubRegistry) ResolveTags

func (d *DockerHubRegistry) ResolveTags(ctx context.Context, image string) ([]*TagDetails, error)

func (*DockerHubRegistry) String

func (d *DockerHubRegistry) String() string

func (*DockerHubRegistry) StripBaseURL

func (d *DockerHubRegistry) StripBaseURL(ref string) (string, error)

type GcrRegistry

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

func (*GcrRegistry) Keychain

func (g *GcrRegistry) Keychain() authn.Keychain

func (*GcrRegistry) ResolveImages

func (g *GcrRegistry) ResolveImages(ctx context.Context, directory string) ([]string, error)

func (*GcrRegistry) ResolveTagDetails

func (g *GcrRegistry) ResolveTagDetails(ctx context.Context, tag *TagDetails) (*TagDetails, error)

func (*GcrRegistry) ResolveTags

func (g *GcrRegistry) ResolveTags(ctx context.Context, image string) ([]*TagDetails, error)

func (*GcrRegistry) String

func (g *GcrRegistry) String() string

func (*GcrRegistry) StripBaseURL

func (g *GcrRegistry) StripBaseURL(ref string) (string, error)

type Registry

type Registry interface {
	fmt.Stringer
	ResolveImages(ctx context.Context, directory string) ([]string, error)
	ResolveTags(ctx context.Context, image string) ([]*TagDetails, error)
	ResolveTagDetails(ctx context.Context, tag *TagDetails) (*TagDetails, error)
	Keychain() authn.Keychain
	StripBaseURL(ref string) (string, error)
}

func FromImageRef

func FromImageRef(log logr.Logger, image string) (Registry, error)

type TagDetails

type TagDetails struct {
	// Image name including registry url and repo, e.g. "docker.io/danielsel/test"
	Image string
	// Digest is the image tag digest
	Digest string
	// Original remembers the original tag url used for the details request
	Original string
	// LastModified stores the last modified timestamp
	LastModified *time.Time
	// Size in bytes
	Size uint64
}

func (*TagDetails) Equals

func (t *TagDetails) Equals(b *TagDetails) bool

func (*TagDetails) String

func (t *TagDetails) String() string

Jump to

Keyboard shortcuts

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