gcr

package
v0.0.0-...-c59f45c Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PerPageCount         = 100
	ParallelImageFetch   = 10
	ImageQueueBufferSize = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Extras

type Extras struct {
	ServiceAccountJSON string `json:"service_account_json" formData:"service_account_json"`
}

type Manifest

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

type Manifests

type Manifests struct {
	MediaType string   `json:"mediaType"`
	Size      int      `json:"size"`
	Digest    string   `json:"digest"`
	Platform  Platform `json:"platform,omitempty"`
}

type ManifestsResp

type ManifestsResp struct {
	SchemaVersion int         `json:"schemaVersion"`
	MediaType     string      `json:"mediaType"`
	Manifests     []Manifests `json:"manifests"`
}

type NonSecret

type NonSecret struct {
	RegistryURL string `json:"registry_url" validate:"required,url"`
	ProjectID   string `json:"project_id" validate:"required,min=6,max=30"`
}

type Platform

type Platform struct {
	Architecture string   `json:"architecture"`
	Os           string   `json:"os"`
	Variant      string   `json:"variant"`
	Features     []string `json:"features"`
}

type RegistryGCR

type RegistryGCR struct {
	Name         string    `json:"name" validate:"required,min=2,max=64"`
	NonSecret    NonSecret `json:"non_secret"`
	Secret       Secret    `json:"secret"`
	Extras       Extras    `json:"extras"`
	RegistryType string    `json:"registry_type" validate:"required"`
}

func New

func New(data []byte) (*RegistryGCR, error)

func (*RegistryGCR) DecryptExtras

func (d *RegistryGCR) DecryptExtras(aes encryption.AES) error

func (*RegistryGCR) DecryptSecret

func (d *RegistryGCR) DecryptSecret(aes encryption.AES) error

func (*RegistryGCR) EncryptExtras

func (d *RegistryGCR) EncryptExtras(aes encryption.AES) error

func (*RegistryGCR) EncryptSecret

func (d *RegistryGCR) EncryptSecret(aes encryption.AES) error

func (*RegistryGCR) FetchImagesFromRegistry

func (d *RegistryGCR) FetchImagesFromRegistry(ctx context.Context) ([]model.IngestedContainerImage, error)

func (*RegistryGCR) GetExtras

func (d *RegistryGCR) GetExtras() map[string]interface{}

func (*RegistryGCR) GetNamespace

func (d *RegistryGCR) GetNamespace() string

func (*RegistryGCR) GetRegistryType

func (d *RegistryGCR) GetRegistryType() string

func (*RegistryGCR) GetSecret

func (d *RegistryGCR) GetSecret() map[string]interface{}

getters

func (*RegistryGCR) GetUsername

func (d *RegistryGCR) GetUsername() string

func (*RegistryGCR) IsValidCredential

func (d *RegistryGCR) IsValidCredential() bool

func (*RegistryGCR) ValidateFields

func (d *RegistryGCR) ValidateFields(v *validator.Validate) error

type RepoDetails

type RepoDetails struct {
	URL        string
	UserName   string
	Password   string
	NameSpace  string
	Repository string
}

type RepoTagsResp

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

type ReposResp

type ReposResp struct {
	Repositories []string `json:"repositories"`
}

type Secret

type Secret struct {
	PrivateKeyID string `json:"private_key_id" validate:"required"`
}

type ServiceAccountJSON

type ServiceAccountJSON struct {
	Type                    string `json:"type"`
	ProjectID               string `json:"project_id"`
	PrivateKeyID            string `json:"private_key_id"`
	PrivateKey              string `json:"private_key"`
	ClientEmail             string `json:"client_email"`
	ClientID                string `json:"client_id"`
	AuthURI                 string `json:"auth_uri"`
	TokenURI                string `json:"token_uri"`
	AuthProviderX509CertURL string `json:"auth_provider_x509_cert_url"`
	ClientX509CertURL       string `json:"client_x509_cert_url"`
}

Jump to

Keyboard shortcuts

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