registry

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProvidersListDirectoryName = "provider"
	MetaDataFileName           = "metadata.yaml"
	SupplementFileName         = "supplement.yaml"
)
View Source
const ModuleGithubRegistryDefaultRepoFullName = "selefra/registry"

ModuleGithubRegistryDefaultRepoFullName The default official module registry

View Source
const (
	ModulesListDirectoryName = "module"
)
View Source
const ProviderGithubRegistryDefaultRepoFullName = "selefra/registry"

ProviderGithubRegistryDefaultRepoFullName The official registry repository

Variables

This section is empty.

Functions

This section is empty.

Types

type Checksums

type Checksums struct {
	LinuxArm64   string `json:"linux_arm64" yaml:"linux_arm64"`
	LinuxAmd64   string `json:"linux_amd64" yaml:"linux_amd64"`
	WindowsArm64 string `json:"windows_arm64" yaml:"windows_arm64"`
	WindowsAmd64 string `json:"windows_amd64" yaml:"windows_amd64"`
	DarwinArm64  string `json:"darwin_arm64" yaml:"darwin_arm64"`
	DarwinAmd64  string `json:"darwin_amd64" yaml:"darwin_amd64"`
}

type Module added in v0.0.9

type Module struct {
	*version.NameAndVersion
}

func NewModule added in v0.0.9

func NewModule(moduleName, moduleVersion string) *Module

func ParseModule added in v0.0.9

func ParseModule(moduleNameAndVersion string) *Module

type ModuleGitHubRegistry added in v0.0.9

type ModuleGitHubRegistry struct {
	// contains filtered or unexported fields
}

func NewModuleGitHubRegistry added in v0.0.9

func NewModuleGitHubRegistry(options *ModuleGithubRegistryOptions) (*ModuleGitHubRegistry, error)

func (*ModuleGitHubRegistry) CheckUpdate added in v0.0.9

func (x *ModuleGitHubRegistry) CheckUpdate(ctx context.Context, module *Module) (*Module, error)

func (*ModuleGitHubRegistry) Download added in v0.0.9

func (x *ModuleGitHubRegistry) Download(ctx context.Context, module *Module, options *ModuleRegistryDownloadOptions) (string, error)

func (*ModuleGitHubRegistry) GetAllVersion added in v0.0.9

func (x *ModuleGitHubRegistry) GetAllVersion(ctx context.Context, module *Module) ([]*Module, error)

func (*ModuleGitHubRegistry) GetLatestVersion added in v0.0.9

func (x *ModuleGitHubRegistry) GetLatestVersion(ctx context.Context, module *Module) (*Module, error)

func (*ModuleGitHubRegistry) GetMetadata added in v0.0.9

func (x *ModuleGitHubRegistry) GetMetadata(ctx context.Context, module *Module) (*ModuleMetadata, error)

func (*ModuleGitHubRegistry) GetSupplement added in v0.0.9

func (x *ModuleGitHubRegistry) GetSupplement(ctx context.Context, module *Module) (*ModuleSupplement, error)

func (*ModuleGitHubRegistry) List added in v0.0.9

func (x *ModuleGitHubRegistry) List(ctx context.Context) ([]*Module, error)

func (*ModuleGitHubRegistry) Search added in v0.0.9

func (x *ModuleGitHubRegistry) Search(ctx context.Context, keyword string) ([]*Module, error)

type ModuleGithubRegistryOptions added in v0.0.9

type ModuleGithubRegistryOptions struct {
	DownloadWorkspace    string
	RegistryRepoFullName *string
}

func NewModuleGithubRegistryOptions added in v0.0.9

func NewModuleGithubRegistryOptions(downloadWorkspace string, registryRepoFullName ...string) *ModuleGithubRegistryOptions

func (*ModuleGithubRegistryOptions) Check added in v0.0.9

type ModuleLocalRegistry added in v0.0.9

type ModuleLocalRegistry struct {
	// contains filtered or unexported fields
}

func NewModuleLocalRegistry added in v0.0.9

func NewModuleLocalRegistry(registryDirectory string, registryGitHubRepoFullName ...string) (*ModuleLocalRegistry, error)

func (*ModuleLocalRegistry) CheckUpdate added in v0.0.9

func (x *ModuleLocalRegistry) CheckUpdate(ctx context.Context, module *Module) (*Module, error)

func (*ModuleLocalRegistry) Download added in v0.0.9

func (x *ModuleLocalRegistry) Download(ctx context.Context, module *Module, options *ModuleRegistryDownloadOptions) (string, error)

func (*ModuleLocalRegistry) GetAllVersion added in v0.0.9

func (x *ModuleLocalRegistry) GetAllVersion(ctx context.Context, module *Module) ([]*Module, error)

func (*ModuleLocalRegistry) GetLatestVersion added in v0.0.9

func (x *ModuleLocalRegistry) GetLatestVersion(ctx context.Context, module *Module) (*Module, error)

func (*ModuleLocalRegistry) GetMetadata added in v0.0.9

func (x *ModuleLocalRegistry) GetMetadata(ctx context.Context, module *Module) (*ModuleMetadata, error)

func (*ModuleLocalRegistry) GetSupplement added in v0.0.9

func (x *ModuleLocalRegistry) GetSupplement(ctx context.Context, module *Module) (*ModuleSupplement, error)

func (*ModuleLocalRegistry) List added in v0.0.9

func (x *ModuleLocalRegistry) List(ctx context.Context) ([]*Module, error)

func (*ModuleLocalRegistry) Search added in v0.0.9

func (x *ModuleLocalRegistry) Search(ctx context.Context, keyword string) ([]*Module, error)

type ModuleMetadata added in v0.0.9

type ModuleMetadata struct {
	Name          string   `json:"name" yaml:"name"`
	LatestVersion string   `json:"latest-version" yaml:"latest-version"`
	LatestUpdate  string   `json:"latest-updated" yaml:"latest-updated"`
	Introduction  string   `json:"introduction" yaml:"introduction"`
	Versions      []string `json:"versions" yaml:"versions"`
}

func (*ModuleMetadata) HasVersion added in v0.0.9

func (x *ModuleMetadata) HasVersion(version string) bool

type ModuleRegistry added in v0.0.9

type ModuleRegistry interface {

	// CheckUpdate Used to check whether a module has a newer version than the current one
	CheckUpdate(ctx context.Context, module *Module) (*Module, error)

	// Download the module to a local registryDirectory
	Download(ctx context.Context, module *Module, options *ModuleRegistryDownloadOptions) (string, error)

	// GetLatestVersion Gets the latest version of a given module
	GetLatestVersion(ctx context.Context, module *Module) (*Module, error)

	// GetAllVersion Gets all versions of a given module
	GetAllVersion(ctx context.Context, module *Module) ([]*Module, error)

	GetMetadata(ctx context.Context, module *Module) (*ModuleMetadata, error)

	GetSupplement(ctx context.Context, module *Module) (*ModuleSupplement, error)

	// List Lists all modules installed locally
	List(ctx context.Context) ([]*Module, error)

	// Search Searches the remote registry for modules containing the given keyword
	Search(ctx context.Context, keyword string) ([]*Module, error)
}

ModuleRegistry Used to represent a registry for a Module repository

type ModuleRegistryDownloadOptions added in v0.0.9

type ModuleRegistryDownloadOptions struct {

	// Which directory to save the downloaded module to
	ModuleDownloadDirectoryPath string

	// Whether to skip authentication. If the authentication is skipped, the checksum of the downloaded file is not verified
	SkipVerify *bool

	// Downloading can be time-consuming, so you can set up a monitor to track progress
	ProgressTracker getter.ProgressTracker
}

type ModuleSupplement added in v0.0.9

type ModuleSupplement struct {
	PackageName string `json:"package-name" yaml:"package-name"`
	Source      string `json:"source" yaml:"source"`
	Checksums   string `json:"checksum" yaml:"checksum"`
}

type Provider

type Provider struct {
	*version.NameAndVersion
}

func NewProvider added in v0.0.9

func NewProvider(providerName, providerVersion string) *Provider

func ParseProvider added in v0.0.9

func ParseProvider(providerNameAndVersion string) *Provider

ParseProvider example: aws@v0.0.1

type ProviderGithubRegistry added in v0.0.9

type ProviderGithubRegistry struct {
	// contains filtered or unexported fields
}

ProviderGithubRegistry provider registry github implementation

func NewProviderGithubRegistry added in v0.0.9

func NewProviderGithubRegistry(options *ProviderGithubRegistryOptions) (*ProviderGithubRegistry, error)

func (*ProviderGithubRegistry) CheckUpdate added in v0.0.9

func (x *ProviderGithubRegistry) CheckUpdate(ctx context.Context, provider *Provider) (*Provider, error)

func (*ProviderGithubRegistry) Download added in v0.0.9

func (*ProviderGithubRegistry) GetAllVersion added in v0.0.9

func (x *ProviderGithubRegistry) GetAllVersion(ctx context.Context, provider *Provider) ([]*Provider, error)

func (*ProviderGithubRegistry) GetLatestVersion added in v0.0.9

func (x *ProviderGithubRegistry) GetLatestVersion(ctx context.Context, provider *Provider) (*Provider, error)

func (*ProviderGithubRegistry) GetMetadata added in v0.0.9

func (x *ProviderGithubRegistry) GetMetadata(ctx context.Context, provider *Provider) (*ProviderMetadata, error)

func (*ProviderGithubRegistry) GetSupplement added in v0.0.9

func (x *ProviderGithubRegistry) GetSupplement(ctx context.Context, provider *Provider) (*ProviderSupplement, error)

func (*ProviderGithubRegistry) List added in v0.0.9

func (*ProviderGithubRegistry) Search added in v0.0.9

func (x *ProviderGithubRegistry) Search(ctx context.Context, keyword string) ([]*Provider, error)

type ProviderGithubRegistryOptions added in v0.0.9

type ProviderGithubRegistryOptions struct {
	DownloadWorkspace    string
	RegistryRepoFullName *string
}

func NewProviderGithubRegistryOptions added in v0.0.9

func NewProviderGithubRegistryOptions(downloadWorkspace string, registryRepoFullName ...string) *ProviderGithubRegistryOptions

func (*ProviderGithubRegistryOptions) Check added in v0.0.9

type ProviderLocalRegistry added in v0.0.9

type ProviderLocalRegistry struct {
	// contains filtered or unexported fields
}

ProviderLocalRegistry The local path implementation of the provider repository

func NewProviderLocalRegistry added in v0.0.9

func NewProviderLocalRegistry(registryDirectory string, registryGitHubRepoFullName ...string) (*ProviderLocalRegistry, error)

func (*ProviderLocalRegistry) CheckUpdate added in v0.0.9

func (x *ProviderLocalRegistry) CheckUpdate(ctx context.Context, provider *Provider) (*Provider, error)

func (*ProviderLocalRegistry) Download added in v0.0.9

func (*ProviderLocalRegistry) GetAllVersion added in v0.0.9

func (x *ProviderLocalRegistry) GetAllVersion(ctx context.Context, provider *Provider) ([]*Provider, error)

func (*ProviderLocalRegistry) GetLatestVersion added in v0.0.9

func (x *ProviderLocalRegistry) GetLatestVersion(ctx context.Context, provider *Provider) (*Provider, error)

func (*ProviderLocalRegistry) GetMetadata added in v0.0.9

func (x *ProviderLocalRegistry) GetMetadata(ctx context.Context, provider *Provider) (*ProviderMetadata, error)

func (*ProviderLocalRegistry) GetSupplement added in v0.0.9

func (x *ProviderLocalRegistry) GetSupplement(ctx context.Context, provider *Provider) (*ProviderSupplement, error)

func (*ProviderLocalRegistry) List added in v0.0.9

func (x *ProviderLocalRegistry) List(ctx context.Context) ([]*Provider, error)

func (*ProviderLocalRegistry) Search added in v0.0.9

func (x *ProviderLocalRegistry) Search(ctx context.Context, keyword string) ([]*Provider, error)

type ProviderMetadata

type ProviderMetadata struct {
	Name          string   `json:"name" yaml:"name"`
	LatestVersion string   `json:"latest-version" yaml:"latest-version"`
	LatestUpdate  string   `json:"latest-updated" yaml:"latest-updated"`
	Introduction  string   `json:"introduction" yaml:"introduction"`
	Versions      []string `json:"versions" yaml:"versions"`
}

func (*ProviderMetadata) HasVersion added in v0.0.9

func (x *ProviderMetadata) HasVersion(version string) bool

type ProviderRegistry added in v0.0.9

type ProviderRegistry interface {

	// CheckUpdate Check whether the given provider has a newer version
	CheckUpdate(ctx context.Context, provider *Provider) (*Provider, error)

	// GetLatestVersion Gets the latest version of the specified provider
	GetLatestVersion(ctx context.Context, provider *Provider) (*Provider, error)

	// GetAllVersion Gets all versions of the given provider
	GetAllVersion(ctx context.Context, provider *Provider) ([]*Provider, error)

	GetMetadata(ctx context.Context, provider *Provider) (*ProviderMetadata, error)

	GetSupplement(ctx context.Context, provider *Provider) (*ProviderSupplement, error)

	// Download the provider of the given version
	Download(ctx context.Context, provider *Provider, options *ProviderRegistryDownloadOptions) (string, error)

	// Search for providers in registry by keyword
	Search(ctx context.Context, keyword string) ([]*Provider, error)

	// List Lists all providers on registry
	List(ctx context.Context) ([]*Provider, error)
}

ProviderRegistry Used to represent the registry of a provider

type ProviderRegistryDownloadOptions added in v0.0.9

type ProviderRegistryDownloadOptions struct {

	// Which directory to save the downloaded provider to
	ProviderDownloadDirectoryPath string

	// Whether to skip authentication. If the authentication is skipped, the checksum of the downloaded file is not verified
	SkipVerify *bool

	// Downloading can be time-consuming, so you can set up a monitor to track progress
	ProgressTracker getter.ProgressTracker
}

ProviderRegistryDownloadOptions Some options when downloading the provider

type ProviderSupplement

type ProviderSupplement struct {
	PackageName string    `json:"package-name" yaml:"package-name"`
	Source      string    `json:"source" yaml:"source"`
	Checksums   Checksums `json:"checksums" yaml:"checksums"`
}

Jump to

Keyboard shortcuts

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