types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChartLayerMediaType = "application/vnd.cncf.helm.chart.layer.v1.tar+gzip"
	ConfigMediaType     = "application/vnd.cncf.helm.config.v1+json"
)

Variables

View Source
var (
	ErrUnsupportedRegistryType = errors.New("unsupported ar type")
	ErrArtifactNotFound        = errors.New("artifact not found")
	ErrRegistryNotFound        = errors.New("ar not found")
	ErrInvalidCredentials      = errors.New("invalid credentials")
)

Common errors

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Name       string
	Version    string
	Type       string
	Registry   string
	Size       int64
	Properties map[string]string
}

type ArtifactType

type ArtifactType string
var (
	DOCKER      ArtifactType = "DOCKER"
	HELM        ArtifactType = "HELM"
	HELM_LEGACY ArtifactType = "HELM_LEGACY"
	GENERIC     ArtifactType = "GENERIC"
	PYTHON      ArtifactType = "PYTHON"
	MAVEN       ArtifactType = "MAVEN"
	NPM         ArtifactType = "NPM"
	NUGET       ArtifactType = "NUGET"
	RPM         ArtifactType = "RPM"
	GO          ArtifactType = "GO"
	CONDA       ArtifactType = "CONDA"
)

type Config

type Config struct {
	Version     string            `yaml:"version"`
	Concurrency int               `yaml:"concurrency"`
	Overwrite   bool              `yaml:"overwrite"`
	Source      RegistryConfig    `yaml:"source"`
	Dest        RegistryConfig    `yaml:"destination"`
	Mappings    []RegistryMapping `yaml:"mappings"`
}

Config represents the top-level configuration structure

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads the configuration from a file

type CredentialsConfig

type CredentialsConfig struct {
	Username string `yaml:"username,omitempty"`
	Password string `yaml:"password,omitempty"`
}

CredentialsConfig defines the credential configuration

type ErrorHook

type ErrorHook struct{}

ErrorHook is a zerolog hook that prints errors using pterm

func (ErrorHook) Run

func (h ErrorHook) Run(e *zerolog.Event, level zerolog.Level, msg string)

Run implements the zerolog.Hook interface

type File

type File struct {
	Name         string
	Registry     string
	Uri          string
	Folder       bool
	Size         int
	LastModified string
	SHA1         string
	SHA2         string
}

type FileStat

type FileStat struct {
	Name     string
	Registry string
	Uri      string
	Status   Status
	Size     int64
	Error    string
}

type HelmOCIConfig

type HelmOCIConfig struct {
	APIVersion  string            `json:"apiVersion"`
	Created     time.Time         `json:"created"`
	Annotations map[string]string `json:"annotations"`
}

type Package

type Package struct {
	Registry string
	Path     string
	Name     string
	Size     int
	URL      string
	Version  string
}

type PackageFiles

type PackageFiles struct {
	File         *File
	DownloadFile io.ReadCloser
	Header       *http.Header
}

type RegistryConfig

type RegistryConfig struct {
	Endpoint    string            `yaml:"endpoint"`
	Type        RegistryType      `yaml:"type"`
	Credentials CredentialsConfig `yaml:"credentials,omitempty"`
	Insecure    bool              `yaml:"insecure" default:"false"`
}

RegistryConfig defines the source ar configuration

type RegistryInfo

type RegistryInfo struct {
	Type string
	URL  string
	Path string
}

type RegistryMapping

type RegistryMapping struct {
	ArtifactType        ArtifactType `yaml:"artifactType"`
	SourceRegistry      string       `yaml:"sourceRegistry"`
	DestinationRegistry string       `yaml:"destinationRegistry"`
	// NOT IMPLEMENTED YET
	IncludePatterns []string `yaml:"includePatterns"`
	ExcludePatterns []string `yaml:"excludePatterns"`
	//Optional
	SourcePackageHostname string `yaml:"sourcePackageHostname"`
}

RegistryMapping defines the mapping between source and destination registries Slashes are used to defined the scope. The format would be - "registry": Create registry at Account level - "org/registry": Create registry at Org level - "org/project/registry": Create registry at Project level

type RegistryType

type RegistryType string
var (
	HAR        RegistryType = "HAR"
	JFROG      RegistryType = "JFROG"
	MOCK_JFROG RegistryType = "MOCK_JFROG"
	NEXUS      RegistryType = "NEXUS"
)

type Repository

type Repository struct {
	// Name is the repository name
	Name string

	// Description is the repository description
	Description string

	// ArtifactCount is the count of artifacts in this repository
	ArtifactCount int

	// Provider is the registry provider (HAR, JFROG)
	Provider RegistryType
}

Repository represents a collection of artifacts

type Status

type Status string
const (
	StatusSuccess Status = "Success"
	StatusSkip    Status = "Skipped"
	StatusFail    Status = "Failed"
)

type TransferStats

type TransferStats struct {
	FileStats []FileStat
}

type TreeNode

type TreeNode struct {
	Name     string
	Key      string
	Children []TreeNode
	IsLeaf   bool
	File     *File
}

type Version

type Version struct {
	Registry string
	Pkg      string
	Name     string
	Path     string
	Size     int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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