gitlab

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: 12 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 Image

type Image struct {
	ID                     int         `json:"id"`
	Name                   string      `json:"name"`
	Path                   string      `json:"path"`
	ProjectID              int         `json:"project_id"`
	Location               string      `json:"location"`
	CreatedAt              time.Time   `json:"created_at"`
	CleanupPolicyStartedAt interface{} `json:"cleanup_policy_started_at"`
	TagsCount              int         `json:"tags_count"`
	Tags                   []Tag       `json:"tags"`
}

type NonSecret

type NonSecret struct {
	GitlabRegistryURL string `json:"gitlab_registry_url" validate:"required,min=2"`
	GitlabServerURL   string `json:"gitlab_server_url" validate:"required,url"`
}

type Project

type Project struct {
	ID                           int    `json:"id"`
	Name                         string `json:"name"`
	ContainerRegistryImagePrefix string `json:"container_registry_image_prefix"`
}

type RegistryGitlab

type RegistryGitlab 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(requestByte []byte) (*RegistryGitlab, error)

func (*RegistryGitlab) DecryptExtras

func (e *RegistryGitlab) DecryptExtras(aes encryption.AES) error

func (*RegistryGitlab) DecryptSecret

func (e *RegistryGitlab) DecryptSecret(aes encryption.AES) error

func (*RegistryGitlab) EncryptExtras

func (e *RegistryGitlab) EncryptExtras(aes encryption.AES) error

func (*RegistryGitlab) EncryptSecret

func (e *RegistryGitlab) EncryptSecret(aes encryption.AES) error

func (*RegistryGitlab) FetchImagesFromRegistry

func (e *RegistryGitlab) FetchImagesFromRegistry(ctx context.Context) ([]model.IngestedContainerImage, error)

func (*RegistryGitlab) GetExtras

func (e *RegistryGitlab) GetExtras() map[string]interface{}

func (*RegistryGitlab) GetNamespace

func (e *RegistryGitlab) GetNamespace() string

func (*RegistryGitlab) GetRegistryType

func (e *RegistryGitlab) GetRegistryType() string

func (*RegistryGitlab) GetSecret

func (e *RegistryGitlab) GetSecret() map[string]interface{}

getters

func (*RegistryGitlab) GetUsername

func (e *RegistryGitlab) GetUsername() string

func (*RegistryGitlab) IsValidCredential

func (e *RegistryGitlab) IsValidCredential() bool

func (*RegistryGitlab) ValidateFields

func (e *RegistryGitlab) ValidateFields(v *validator.Validate) error

type RepoDetails

type RepoDetails struct {
	URL         string
	TagName     string
	AccessToken string
	ProjectID   int
	ImageID     int
	ImagePath   string
}

type Secret

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

type Tag

type Tag struct {
	Name     string `json:"name"`
	Path     string `json:"path"`
	Location string `json:"location"`
}

type TagDetail

type TagDetail struct {
	Name          string `json:"name"`
	Path          string `json:"path"`
	Location      string `json:"location"`
	Revision      string `json:"revision"`
	ShortRevision string `json:"short_revision"`
	Digest        string `json:"digest"`
	CreatedAt     string `json:"created_at"`
	Totalsize     int    `json:"total_size"`
}

Jump to

Keyboard shortcuts

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