Documentation
¶
Overview ¶
Package compose with tools to download and compose packages
Index ¶
- Constants
- Variables
- func AddPackage(doCreate bool, newDependency *Dependency, rawStrategies *RawStrategies, ...) error
- func DeletePackages(packages []string, dir string) error
- func EnsureDirExists(path string) error
- func EnumVarP(cmd *launchr.Command, value *string, name, shorthand string, ...)
- func UpdatePackage(dependency *Dependency, rawStrategies *RawStrategies, dir string) error
- func UpdatePackages(dir string) error
- type Builder
- type Composer
- type ComposerOptions
- type Dependency
- type DownloadManager
- type Downloader
- type EnumValue
- type Package
- type RawStrategies
- type Source
- type Strategy
- type YamlCompose
Constants ¶
const ( MainDir = ".compose" // MainDir is a compose directory. BuildDir = MainDir + "/build" // BuildDir is a result directory of compose action. )
const ( // GitType is const for GIT source type download. GitType = "git" // SourceReferenceTag represents git tag source. SourceReferenceTag = "tag" // SourceReferenceBranch represents git branch source. SourceReferenceBranch = "ref" // HTTPType is const for http source type download. HTTPType = "http" )
const (
// DependencyRoot is a dependencies graph main node
DependencyRoot = "root"
)
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 AddPackage ¶ added in v0.9.0
func AddPackage(doCreate bool, newDependency *Dependency, rawStrategies *RawStrategies, dir string) error
AddPackage adds a new package to plasma-compose.
func DeletePackages ¶ added in v0.9.0
DeletePackages removes packages plasma-compose.
func EnsureDirExists ¶
EnsureDirExists checks if directory exists, otherwise create it
func EnumVarP ¶ added in v0.9.0
func EnumVarP(cmd *launchr.Command, value *string, name, shorthand string, defaultValue string, enumValues []string, usage string)
EnumVarP adds custom enum flag to cobra command.
func UpdatePackage ¶ added in v0.9.0
func UpdatePackage(dependency *Dependency, rawStrategies *RawStrategies, dir string) error
UpdatePackage updates a single package in plasma-compose.
func UpdatePackages ¶ added in v0.9.0
UpdatePackages updates packages in plasma-compose in interactive way.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder struct, provides methods to merge packages into build
type Composer ¶
type Composer struct {
// 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(c *YamlCompose, targetDir string) ([]*Package, error)
Download packages using compose file
type Downloader ¶
Downloader interface
type EnumValue ¶ added in v0.9.0
type EnumValue struct {
Enum []string
// contains filtered or unexported fields
}
EnumValue struct to hold enumeration.
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"`
Tag string `yaml:"tag,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