compose

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package compose with tools to download and compose packages

Index

Constants

View Source
const (
	// DependencyRoot is dependecies 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 Auth

type Auth struct {
	Name     string `yaml:"name"`
	Password string `yaml:"password"`
}

Auth stores package source definition

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(fs fs.FS, pwd string, opts ComposerOptions) (*Composer, error)

CreateComposer instance

func (*Composer) RunInstall

func (c *Composer) RunInstall() error

RunInstall on composr

type ComposerOptions

type ComposerOptions struct {
	WorkingDir string
}

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 {
}

DownloadManager struct, provides methods to fetch packages

func CreateDownloadManager

func CreateDownloadManager() DownloadManager

CreateDownloadManager instance

func (DownloadManager) DownloadViaCompose

func (m DownloadManager) DownloadViaCompose(c *YamlCompose, targetDir string) ([]*Package, error)

DownloadViaCompose packages using compose file

func (DownloadManager) DownloadViaLock

func (m DownloadManager) DownloadViaLock(l *YamlLock, targetDir string) ([]*Package, error)

DownloadViaLock packages using compose lock file

type Downloader

type Downloader interface {
	Download(pkg *Package, targetDir string) 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) GetAuth

func (p *Package) GetAuth() *Auth

GetAuth from package source

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) 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"`
	Auth Auth   `yaml:"auth,omitempty"`
}

Source stores package source definition

type YamlCompose

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

YamlCompose stores compose definition

type YamlLock

type YamlLock struct {
	Hash     string     `yaml:"hash"`
	Packages []*Package `yaml:"packages,omitempty"`
}

YamlLock stores lock definition

Jump to

Keyboard shortcuts

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