run

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ProjectStateActive is the state of active project.
	ProjectStateActive = "ACTIVE"
)

Variables

This section is empty.

Functions

func GetImages

func GetImages(ctx context.Context, in *types.SimpleQuery) ([]*types.ImageItem, error)

Types

type ClientProvider

type ClientProvider func(ctx context.Context, credProvider CredentialProvider) (*http.Client, error)

type CredentialProvider

type CredentialProvider func(ctx context.Context) (*google.Credentials, error)

type GoogleAPIClient

type GoogleAPIClient interface {
	Get(ctx context.Context, req *http.Request, v any) error
	Head(ctx context.Context, req *http.Request, key string) (string, error)
}

type ImageInfo

type ImageInfo struct {
	IsGCR    bool   `json:"-"`
	IsAR     bool   `json:"-"`
	IsLatest bool   `json:"isLatest"`
	Deployed string `json:"deployed"`
	Name     string `json:"name"`
	Tag      string `json:"tag"`
	Digest   string `json:"digest"`
	Region   string `json:"region"`
	Registry string `json:"registry"`
	Project  string `json:"project"`
	Folder   string `json:"registryFolder"`
}

ImageInfo represents parsed GCP registry image (GCR or AR).

func ParseImageInfo

func ParseImageInfo(uri string) (*ImageInfo, error)

ParseImageInfo parses image string into ImageInfo struct. Supported formats:

  • gcr.io/cloudy-demos/hello-broken
  • gcr.io/cloudy-demos/hello-broken:latest
  • gcr.io/cloudy-demos/hello-broken@sha256:1234567890
  • gcr.io/cloudy-demos/hello-broken:v0.8.3
  • us.gcr.io/cloudy-demos/hello-broken:v0.8.3
  • us-west1-docker.pkg.dev/cloudy-demos/artomator/artomator
  • us-west1-docker.pkg.dev/cloudy-demos/artomator/artomator:latest
  • us-west1-docker.pkg.dev/cloudy-demos/artomator/artomator:v0.8.3
  • us-west1-docker.pkg.dev/cloudy-demos/artomator/artomator@sha256:1234567890
  • us-docker.pkg.dev/cloudy-demos/test-multiregion

func (*ImageInfo) ManifestURL

func (i *ImageInfo) ManifestURL() string

ManifestURL returns manifest URL for the image.

func (*ImageInfo) URI

func (i *ImageInfo) URI() string

func (*ImageInfo) URL

func (i *ImageInfo) URL() string

Jump to

Keyboard shortcuts

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