harbor

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 Artifact

type Artifact struct {
	Digest            string    `json:"digest"`
	Icon              string    `json:"icon"`
	ID                int       `json:"id"`
	ManifestMediaType string    `json:"manifest_media_type"`
	MediaType         string    `json:"media_type"`
	ProjectID         int       `json:"project_id"`
	PullTime          time.Time `json:"pull_time"`
	PushTime          time.Time `json:"push_time"`
	RepositoryID      int       `json:"repository_id"`
	Size              int       `json:"size"`
	Tags              []Tags    `json:"tags"`
	Type              string    `json:"type"`
}

type NonSecret

type NonSecret struct {
	HarborRegistryURL string `json:"harbor_registry_url" validate:"required,url"`
	HarborUsername    string `json:"harbor_username" validate:"omitempty,min=2"`
	HarborProjectName string `json:"harbor_project_name" validate:"required,min=2"`
}

type RegistryHarbor

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

func New

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

func (*RegistryHarbor) DecryptExtras

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

func (*RegistryHarbor) DecryptSecret

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

func (*RegistryHarbor) EncryptExtras

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

func (*RegistryHarbor) EncryptSecret

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

func (*RegistryHarbor) FetchImagesFromRegistry

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

func (*RegistryHarbor) GetExtras

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

func (*RegistryHarbor) GetNamespace

func (d *RegistryHarbor) GetNamespace() string

func (*RegistryHarbor) GetRegistryType

func (d *RegistryHarbor) GetRegistryType() string

func (*RegistryHarbor) GetSecret

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

getters

func (*RegistryHarbor) GetUsername

func (d *RegistryHarbor) GetUsername() string

func (*RegistryHarbor) IsValidCredential

func (d *RegistryHarbor) IsValidCredential() bool

func (*RegistryHarbor) ValidateFields

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

type RepoDetails

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

type Repository

type Repository struct {
	UpdateTime    time.Time `json:"update_time"`
	Description   string    `json:"description"`
	PullCount     int       `json:"pull_count"`
	CreationTime  time.Time `json:"creation_time"`
	ArtifactCount int       `json:"artifact_count"`
	ProjectID     int       `json:"project_id"`
	ID            int       `json:"id"`
	Name          string    `json:"name"`
}

type Secret

type Secret struct {
	HarborPassword string `json:"harbor_password" validate:"omitempty,min=2"`
}

type Tags

type Tags struct {
	ArtifactID   int       `json:"artifact_id"`
	ID           int       `json:"id"`
	Immutable    bool      `json:"immutable"`
	Name         string    `json:"name"`
	PullTime     time.Time `json:"pull_time"`
	PushTime     time.Time `json:"push_time"`
	RepositoryID int       `json:"repository_id"`
	Signed       bool      `json:"signed"`
}

Jump to

Keyboard shortcuts

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