compose

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Overview

Package compose with tools to download and compose packages

Index

Constants

View Source
const (
	// MainDir is a compose directory.
	MainDir = ".compose"
	// BuildDir is a result directory of compose action.
	BuildDir = MainDir + "/build"
)
View Source
const (
	// GitType is const for GIT source type download.
	GitType = "git"
	// HTTPType is const for http source type download.
	HTTPType = "http"
)
View Source
const (
	// DependencyRoot is a dependencies graph main node
	DependencyRoot = "root"
)
View Source
const (
	// TargetLatest is a fallback to the latest version.
	TargetLatest = "latest"
)

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 EnsureDirExists

func EnsureDirExists(path string) error

EnsureDirExists checks if directory exists, otherwise create it

func IsEmptyDir added in v0.12.0

func IsEmptyDir(name string) (bool, error)

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

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(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

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) 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"`
	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

func Lookup added in v0.10.0

func Lookup(fsys fs.FS) (*YamlCompose, error)

Lookup allows to search compose file, read and parse it.

Jump to

Keyboard shortcuts

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