compose

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Overview

Package compose with tools to download and compose packages

Index

Constants

View Source
const (
	MainDir  = ".compose"         // MainDir is a compose directory.
	BuildDir = MainDir + "/build" // BuildDir is a result directory of compose action.

)
View Source
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"
)
View Source
const (
	// DependencyRoot is a dependencies graph main node
	DependencyRoot = "root"
)

Variables

View Source
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

func DeletePackages(packages []string, dir string) error

DeletePackages removes packages plasma-compose.

func EnsureDirExists

func EnsureDirExists(path string) error

EnsureDirExists checks if directory exists, otherwise create it

func EnumVarP added in v0.9.0

func EnumVarP(cmd *cobra.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

func UpdatePackages(dir string) error

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

func CreateComposer(pwd string, opts ComposerOptions, k keyring.Keyring) (*Composer, error)

CreateComposer instance

func (*Composer) RunInstall

func (c *Composer) RunInstall() error

RunInstall on Composer

type ComposerOptions

type ComposerOptions struct {
	Clean              bool
	WorkingDir         string
	SkipNotVersioned   bool
	ConflictsVerbosity bool
	Interactive        bool
}

ComposerOptions - list of possible composer options

type Dependency

type Dependency struct {
	Name   string `yaml:"name"`
	Source Source `yaml:"source,omitempty"`
}

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

type Downloader interface {
	Download(pkg *Package, targetDir string, kw *keyringWrapper) error
}

Downloader interface

type EnumValue added in v0.9.0

type EnumValue struct {
	Enum []string
	// contains filtered or unexported fields
}

EnumValue struct to hold enumeration.

func (*EnumValue) Set added in v0.9.0

func (e *EnumValue) Set(value string) error

Set sets EnumValue.

func (*EnumValue) String added in v0.9.0

func (e *EnumValue) String() string

func (*EnumValue) Type added in v0.9.0

func (e *EnumValue) Type() string

Type returns a string name for this EnumValue type

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

func (p *Package) AddDependency(dep string)

AddDependency appends new package dependency

func (*Package) GetName

func (p *Package) GetName() string

GetName from package

func (*Package) GetRef

func (p *Package) GetRef() string

GetRef from package source

func (*Package) GetStrategies added in v0.0.5

func (p *Package) GetStrategies() []Strategy

GetStrategies from package

func (*Package) GetTag added in v0.0.2

func (p *Package) GetTag() string

GetTag from package source

func (*Package) GetTarget added in v0.1.3

func (p *Package) GetTarget() string

GetTarget returns a target version of package

func (*Package) GetType

func (p *Package) GetType() string

GetType from package source

func (*Package) GetURL

func (p *Package) GetURL() string

GetURL from package source

type RawStrategies added in v0.9.0

type RawStrategies struct {
	Names []string
	Paths []string
}

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 Strategy added in v0.0.5

type Strategy struct {
	Name  string   `yaml:"name"`
	Paths []string `yaml:"path"`
}

Strategy stores packages merge strategy name and Paths

type YamlCompose

type YamlCompose struct {
	Name         string       `yaml:"name"`
	Dependencies []Dependency `yaml:"dependencies,omitempty"`
}

YamlCompose stores compose definition

Jump to

Keyboard shortcuts

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