Documentation
¶
Overview ¶
Package compose with tools to download and compose packages
Index ¶
- Constants
- Variables
- func EnsureDirExists(path string) error
- func IsEmptyDir(name string) (bool, error)
- type Builder
- type Composer
- type ComposerOptions
- type Dependency
- type DownloadManager
- type Downloader
- type FormsAction
- func (f *FormsAction) AddPackage(doCreate bool, newDependency *Dependency, rawStrategies *RawStrategies, ...) error
- func (f *FormsAction) DeletePackages(packages []string, dir string) error
- func (f *FormsAction) UpdatePackage(dependency *Dependency, rawStrategies *RawStrategies, dir string) error
- func (f *FormsAction) UpdatePackages(dir string) error
- type Package
- type RawStrategies
- type Source
- type Strategy
- type YamlCompose
Constants ¶
const ( // MainDir is a compose directory. MainDir = ".compose" // BuildDir is a result directory of compose action. BuildDir = MainDir + "/build" )
const ( // GitType is const for GIT source type download. GitType = "git" // HTTPType is const for http source type download. HTTPType = "http" )
const (
// DependencyRoot is a dependencies graph main node
DependencyRoot = "root"
)
const (
// TargetLatest is a fallback to the latest version.
TargetLatest = "latest"
)
Variables ¶
var ( // StrategyOverwriteLocal string const StrategyOverwriteLocal = "overwrite-local-file" // StrategyRemoveExtraLocal string const StrategyRemoveExtraLocal = "remove-extra-local-files" // StrategyIgnoreExtraPackage string const StrategyIgnoreExtraPackage = "ignore-extra-package-files" // StrategyFilterPackage string const StrategyFilterPackage = "filter-package-files" )
Functions ¶
func EnsureDirExists ¶
EnsureDirExists checks if directory exists, otherwise create it
func IsEmptyDir ¶ added in v0.12.0
IsEmptyDir check if directory has at least 1 file.
Types ¶
type Builder ¶
type Builder struct {
action.WithLogger
action.WithTerm
// contains filtered or unexported fields
}
Builder struct, provides methods to merge packages into build
type Composer ¶
type Composer struct {
action.WithLogger
action.WithTerm
// contains filtered or unexported fields
}
Composer stores compose definition
func CreateComposer ¶
CreateComposer instance
type ComposerOptions ¶
type ComposerOptions struct {
Clean bool
WorkingDir string
SkipNotVersioned bool
ConflictsVerbosity bool
Interactive bool
}
ComposerOptions - list of possible composer options
type Dependency ¶
Dependency stores Dependency definition
func (*Dependency) ToPackage ¶
func (d *Dependency) ToPackage(name string) *Package
ToPackage converts dependency to package
type DownloadManager ¶
type DownloadManager struct {
// contains filtered or unexported fields
}
DownloadManager struct, provides methods to fetch packages
func CreateDownloadManager ¶
func CreateDownloadManager(keyring *keyringWrapper) DownloadManager
CreateDownloadManager instance
func (DownloadManager) Download ¶ added in v0.0.5
func (m DownloadManager) Download(ctx context.Context, c *YamlCompose, targetDir string) ([]*Package, error)
Download packages using compose file
type Downloader ¶
type Downloader interface {
Download(ctx context.Context, pkg *Package, targetDir string) error
EnsureLatest(pkg *Package, downloadPath string) (bool, error)
}
Downloader interface
type FormsAction ¶ added in v0.15.0
type FormsAction struct {
action.WithLogger
action.WithTerm
}
FormsAction provides form operations with compose file.
func (*FormsAction) AddPackage ¶ added in v0.15.0
func (f *FormsAction) AddPackage(doCreate bool, newDependency *Dependency, rawStrategies *RawStrategies, dir string) error
AddPackage adds a new package to plasma-compose.
func (*FormsAction) DeletePackages ¶ added in v0.15.0
func (f *FormsAction) DeletePackages(packages []string, dir string) error
DeletePackages removes packages plasma-compose.
func (*FormsAction) UpdatePackage ¶ added in v0.15.0
func (f *FormsAction) UpdatePackage(dependency *Dependency, rawStrategies *RawStrategies, dir string) error
UpdatePackage updates a single package in plasma-compose.
func (*FormsAction) UpdatePackages ¶ added in v0.15.0
func (f *FormsAction) UpdatePackages(dir string) error
UpdatePackages updates packages in plasma-compose in interactive way.
type Package ¶
type Package struct {
Name string `yaml:"name"`
Source Source `yaml:"source,omitempty"`
Dependencies []string `yaml:"dependencies,omitempty"`
}
Package stores package definition
func (*Package) AddDependency ¶
AddDependency appends new package dependency
func (*Package) GetStrategies ¶ added in v0.0.5
GetStrategies from package
type RawStrategies ¶ added in v0.9.0
RawStrategies represents collection of submitted flags for strategies.
type Source ¶
type Source struct {
Type string `yaml:"type"`
URL string `yaml:"url"`
Ref string `yaml:"ref,omitempty"`
Strategies []Strategy `yaml:"strategy,omitempty"`
}
Source stores package source definition
type YamlCompose ¶
type YamlCompose struct {
Name string `yaml:"name"`
Dependencies []Dependency `yaml:"dependencies,omitempty"`
}
YamlCompose stores compose definition