compose

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

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

Variables

This section is empty.

Functions

func EnsureDirExists

func EnsureDirExists(path string) error

EnsureDirExists checks if directory exists, otherwise create it

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 composr

type ComposerOptions

type ComposerOptions struct {
	Clean              bool
	WorkingDir         string
	SkipNotVersioned   bool
	ConflictsVerbosity 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 keyring.Keyring) 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, ci keyring.CredentialsItem) error
}

Downloader interface

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 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"`
	Path string `yaml:"path"`
}

Strategy stores packages merge strategy name and path

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