domain

package
v1.26.2-0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPackageType = errors.New("package type is invalid")

Functions

This section is empty.

Types

type ChecksumDownloader

type ChecksumDownloader interface {
	DownloadChecksum(ctx context.Context, logE *logrus.Entry, rt *runtime.Runtime, pkg *config.Package) (io.ReadCloser, int64, error)
}

type Checksums

type Checksums interface {
	Get(key string) string
	Set(key, value string)
	ReadFile(fs afero.Fs, p string) error
	UpdateFile(fs afero.Fs, p string) error
}

type ConfigReader

type ConfigReader interface {
	Read(configFilePath string, cfg *aqua.Config) error
}

type CosignInstaller added in v1.26.0

type CosignInstaller interface {
	InstallCosign(ctx context.Context, logE *logrus.Entry, version string) error
}

type DownloadGitHubReleaseParam

type DownloadGitHubReleaseParam struct {
	RepoOwner string
	RepoName  string
	Version   string
	Asset     string
}

type FindResult added in v1.20.0

type FindResult struct {
	Package        *config.Package
	File           *registry.File
	Config         *aqua.Config
	ExePath        string
	ConfigFilePath string
	EnableChecksum bool
}

type GitHubContentFile

type GitHubContentFile struct {
	ReadCloser io.ReadCloser
	String     string
}

type GitHubContentFileDownloader

type GitHubContentFileDownloader interface {
	DownloadGitHubContentFile(ctx context.Context, logE *logrus.Entry, param *GitHubContentFileParam) (*GitHubContentFile, error)
}

type GitHubContentFileParam

type GitHubContentFileParam struct {
	RepoOwner string
	RepoName  string
	Ref       string
	Path      string
}

type GitHubReleaseDownloader

type GitHubReleaseDownloader interface {
	DownloadGitHubRelease(ctx context.Context, logE *logrus.Entry, param *DownloadGitHubReleaseParam) (io.ReadCloser, int64, error)
}

type Linker added in v1.22.0

type Linker interface {
	Lstat(s string) (os.FileInfo, error)
	Symlink(dest, src string) error
	Readlink(src string) (string, error)
}

func NewMockLinker added in v1.22.0

func NewMockLinker(fs afero.Fs) Linker

type MockChecksumDownloader added in v1.22.0

type MockChecksumDownloader struct {
	Body string
	Code int64
	Err  error
}

func (*MockChecksumDownloader) DownloadChecksum added in v1.22.0

func (chkDL *MockChecksumDownloader) DownloadChecksum(ctx context.Context, logE *logrus.Entry, rt *runtime.Runtime, pkg *config.Package) (io.ReadCloser, int64, error)

type MockConfigReader added in v1.22.0

type MockConfigReader struct {
	Cfg *aqua.Config
	Err error
}

func (*MockConfigReader) Read added in v1.22.0

func (reader *MockConfigReader) Read(configFilePath string, cfg *aqua.Config) error

type MockCosignInstaller added in v1.26.0

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

func (*MockCosignInstaller) InstallCosign added in v1.26.0

func (mock *MockCosignInstaller) InstallCosign(ctx context.Context, logE *logrus.Entry, version string) error

type MockPolicyChecker added in v1.24.0

type MockPolicyChecker struct {
	Err error
}

func (*MockPolicyChecker) ValidatePackage added in v1.24.0

func (pc *MockPolicyChecker) ValidatePackage(param *policy.ParamValidatePackage) error

type MockPolicyConfigReader added in v1.24.0

type MockPolicyConfigReader struct {
	Cfgs []*policy.Config
	Err  error
}

func (*MockPolicyConfigReader) Read added in v1.24.0

func (reader *MockPolicyConfigReader) Read(files []string) ([]*policy.Config, error)

type MockRegistryInstaller added in v1.22.0

type MockRegistryInstaller struct {
	M   map[string]*registry.Config
	Err error
}

func (*MockRegistryInstaller) InstallRegistries added in v1.22.0

func (inst *MockRegistryInstaller) InstallRegistries(ctx context.Context, logE *logrus.Entry, cfg *aqua.Config, cfgFilePath string) (map[string]*registry.Config, error)

type MockWhichController added in v1.22.0

type MockWhichController struct {
	FindResult *FindResult
	Err        error
}

func (*MockWhichController) Which added in v1.22.0

func (ctrl *MockWhichController) Which(ctx context.Context, logE *logrus.Entry, param *config.Param, exeName string) (*FindResult, error)

type PackageInstaller

type PackageInstaller interface {
	InstallPackage(ctx context.Context, logE *logrus.Entry, param *ParamInstallPackage) error
	InstallPackages(ctx context.Context, logE *logrus.Entry, param *ParamInstallPackages) error
	InstallProxy(ctx context.Context, logE *logrus.Entry) error
}

type ParamInstallPackage added in v1.20.0

type ParamInstallPackage struct {
	Pkg             *config.Package
	Checksums       *checksum.Checksums
	RequireChecksum bool
	PolicyConfigs   []*policy.Config
	ConfigFileDir   string
	CosignExePath   string
}

type ParamInstallPackages added in v1.19.0

type ParamInstallPackages struct {
	ConfigFilePath string
	Config         *aqua.Config
	Registries     map[string]*registry.Config
	Tags           map[string]struct{}
	ExcludedTags   map[string]struct{}
	SkipLink       bool
	PolicyConfigs  []*policy.Config
}

type PolicyChecker added in v1.24.0

type PolicyChecker interface {
	ValidatePackage(param *policy.ParamValidatePackage) error
}

type PolicyConfigReader added in v1.24.0

type PolicyConfigReader interface {
	Read([]string) ([]*policy.Config, error)
}

type RegistryInstaller

type RegistryInstaller interface {
	InstallRegistries(ctx context.Context, logE *logrus.Entry, cfg *aqua.Config, cfgFilePath string) (map[string]*registry.Config, error)
}

type RepositoriesService

type RepositoriesService interface {
	GetArchiveLink(ctx context.Context, owner, repo string, archiveformat github.ArchiveFormat, opts *github.RepositoryContentGetOptions, followRedirects bool) (*url.URL, *github.Response, error)
	GetReleaseByTag(ctx context.Context, owner, repoName, version string) (*github.RepositoryRelease, *github.Response, error)
	DownloadReleaseAsset(ctx context.Context, owner, repoName string, assetID int64, httpClient *http.Client) (io.ReadCloser, string, error)
	GetContents(ctx context.Context, repoOwner, repoName, path string, opt *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)
}

type WhichController added in v1.20.0

type WhichController interface {
	Which(ctx context.Context, logE *logrus.Entry, param *config.Param, exeName string) (*FindResult, error)
}

Jump to

Keyboard shortcuts

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