repository

package
v0.0.0-...-b21b196 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRepo

func CreateRepo(kwargs *types.CmdKwargs) error

func CreateRepo(dest string, roles_only bool, collectios_only bool) error {

func DeduplicateSpecs

func DeduplicateSpecs(specs *[]utils.InstallSpec)

func DownloadFile

func DownloadFile(url, dest string) error

func ExtractRoleManifestsFromTarGz

func ExtractRoleManifestsFromTarGz(tarGzPath string) ([]types.RoleMeta, error)

func GetRoleMetaFromTarball

func GetRoleMetaFromTarball(f string) (types.RoleMeta, error)

func RoleSpecToManifestCandidates

func RoleSpecToManifestCandidates(spec utils.InstallSpec, manifests *[]types.RoleMeta) []types.RoleMeta

func SortInstallSpecs

func SortInstallSpecs(specs *[]utils.InstallSpec)

func SortRoleManifestsByVersion

func SortRoleManifestsByVersion(manifests []types.RoleMeta) ([]types.RoleMeta, error)

Types

type CollectionCachedFileInfo

type CollectionCachedFileInfo struct {
	Namespace      string `json:"namespace"`
	Name           string `json:"name"`
	Version        string `json:"version"`
	FileName       string `json:"filename"`
	FileType       string `json:"filetype"`
	CheckSumSHA256 string `json:"chksum_sha256"`
}

type CollectionFileInfo

type CollectionFileInfo struct {
	Name           string `json:"name"`
	FType          string `json:"ftype"`
	CheckSumType   string `json:"chksum_type"`
	CheckSumSHA256 string `json:"chksum_sha256"`
}

type CollectionFilesMeta

type CollectionFilesMeta struct {
	Files []CollectionFileInfo `json:"files"`
}

type CollectionInfo

type CollectionInfo struct {
	Namespace    string            `json:"namespace"`
	Name         string            `json:"name"`
	Version      string            `json:"version"`
	Dependencies map[string]string `json:"dependencies"`
}

type CollectionManifest

type CollectionManifest struct {
	CollectionInfo CollectionInfo `json:"collection_info"`
}

func ExtractCollectionManifestsFromTarGz

func ExtractCollectionManifestsFromTarGz(tarGzPath string) ([]CollectionManifest, error)

func SortManifestsByVersion

func SortManifestsByVersion(manifests []CollectionManifest) ([]CollectionManifest, error)

func SpecToManifestCandidates

func SpecToManifestCandidates(spec utils.InstallSpec, manifests *[]CollectionManifest) []CollectionManifest

Given a utils.InstallSpec, reduce a list of repository.Manifest down to the matching candidates via their namespace, name and version (which can include an operator)

type FileRepoClient

type FileRepoClient struct {
	CachePath           string
	BasePath            string
	Date                string
	RepoMeta            RepoMetaFile
	CollectionManifests RepoMetaFile
	CollectionFiles     RepoMetaFile
	RoleManifests       RepoMetaFile
	RoleFiles           RepoMetaFile
}

func (*FileRepoClient) FetchRepoMeta

func (client *FileRepoClient) FetchRepoMeta(cachePath string) error

func (*FileRepoClient) GetCacheFileLocationForInstallSpec

func (client *FileRepoClient) GetCacheFileLocationForInstallSpec(spec utils.InstallSpec) string

func (*FileRepoClient) GetCacheRoleFileLocationForInstallSpec

func (client *FileRepoClient) GetCacheRoleFileLocationForInstallSpec(spec utils.InstallSpec) string

func (*FileRepoClient) GetRepoMetaDate

func (client *FileRepoClient) GetRepoMetaDate() (string, error)

func (*FileRepoClient) InitCache

func (client *FileRepoClient) InitCache(cachePath string) error

func (*FileRepoClient) ResolveCollectionDeps

func (client *FileRepoClient) ResolveCollectionDeps(spec utils.InstallSpec) ([]utils.InstallSpec, error)

func (*FileRepoClient) ResolveRoleDeps

func (client *FileRepoClient) ResolveRoleDeps(spec utils.InstallSpec) ([]utils.InstallSpec, error)

type HttpRepoClient

type HttpRepoClient struct {
	CachePath           string
	BaseURL             string
	Date                string
	RepoMeta            RepoMetaFile
	CollectionManifests RepoMetaFile
	CollectionFiles     RepoMetaFile
	RoleManifests       RepoMetaFile
	RoleFiles           RepoMetaFile
}

func (*HttpRepoClient) FetchRepoMeta

func (client *HttpRepoClient) FetchRepoMeta(cachePath string) error

func (*HttpRepoClient) GetCacheFileLocationForInstallSpec

func (client *HttpRepoClient) GetCacheFileLocationForInstallSpec(spec utils.InstallSpec) string

func (*HttpRepoClient) GetCacheRoleFileLocationForInstallSpec

func (client *HttpRepoClient) GetCacheRoleFileLocationForInstallSpec(spec utils.InstallSpec) string

func (*HttpRepoClient) GetRepoMetaDate

func (client *HttpRepoClient) GetRepoMetaDate() (string, error)

func (*HttpRepoClient) InitCache

func (client *HttpRepoClient) InitCache(cachePath string) error

func (*HttpRepoClient) ResolveCollectionDeps

func (client *HttpRepoClient) ResolveCollectionDeps(spec utils.InstallSpec) ([]utils.InstallSpec, error)

func (*HttpRepoClient) ResolveRoleDeps

func (client *HttpRepoClient) ResolveRoleDeps(spec utils.InstallSpec) ([]utils.InstallSpec, error)

type RepoClient

type RepoClient interface {
	FetchRepoMeta(cachePath string) error
	//GetRepoMeta(cachePath string) (RepoMeta, error)
	GetRepoMetaDate() (string, error)
	ResolveCollectionDeps(spec utils.InstallSpec) ([]utils.InstallSpec, error)
	ResolveRoleDeps(spec utils.InstallSpec) ([]utils.InstallSpec, error)
	GetCacheFileLocationForInstallSpec(spec utils.InstallSpec) string
	GetCacheRoleFileLocationForInstallSpec(spec utils.InstallSpec) string
}

func GetRepoClient

func GetRepoClient(repo string, cachePath string) (RepoClient, error)

type RepoMeta

type RepoMeta struct {
	Date                string       `json:"date"`
	CollectionManifests RepoMetaFile `json:"collection_manifests"`
	CollectionFiles     RepoMetaFile `json:"collection_files"`
	RoleManifests       RepoMetaFile `json:"role_manifests"`
	RoleFiles           RepoMetaFile `json:"role_files"`
}

type RepoMetaFile

type RepoMetaFile struct {
	Date     string `json:"date"`
	Filename string `json:"filename"`
}

type RoleCachedFileInfo

type RoleCachedFileInfo struct {
	Namespace string `json:"namespace"`
	Name      string `json:"name"`
	Version   string `json:"version"`
	FileName  string `json:"filename"`
	FileType  string `json:"filetype"`
}

Jump to

Keyboard shortcuts

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