environment

package
v0.0.0-...-847e9cf Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Import

func Import(srcFile string) (uuid.UUID, error)

Import (extract) an environment

func IsExisting

func IsExisting(uuid uuid.UUID) (bool, error)

IsExisting checks if environment with specified id exists

Types

type Environment

type Environment struct {
	Name      string                      `yaml:"name"`
	Uuid      uuid.UUID                   `yaml:"uuid"`
	Installed []InstalledComponentVersion `yaml:"installed"`
	SshConfig SshConfig                   `yaml:"ssh-config,omitempty"`
}

Environment struct holds all information about managed environment with list of InstalledComponentVersion

func Create

func Create(name string) (*Environment, error)

Create new environment with given name

func Get

func Get(uuid uuid.UUID) (*Environment, error)

Get Environment bu uuid

func GetAll

func GetAll() ([]*Environment, error)

GetAll existing Environment

func (*Environment) AddRsaKeyPair

func (e *Environment) AddRsaKeyPair(rsaKeyPair auth.RsaKeyPair)

func (*Environment) Export

func (e *Environment) Export(dstDir string) error

Export (archive) an environment

func (*Environment) GetComponentByName

func (e *Environment) GetComponentByName(name string) (*InstalledComponentVersion, error)

GetComponentByName returns first InstalledComponentVersion found by name

func (*Environment) Install

func (e *Environment) Install(newComponent InstalledComponentVersion) error

func (*Environment) Save

func (e *Environment) Save() error

Save updated Environment to file

func (*Environment) String

func (e *Environment) String() string

The String method is used to pretty-print Environment struct

type InstalledComponentCommand

type InstalledComponentCommand struct {
	Name        string            `yaml:"name"`
	Description string            `yaml:"description"`
	Command     string            `yaml:"command"`
	Envs        map[string]string `yaml:"envs"`
	Args        []string          `yaml:"args"`
}

InstalledComponentCommand holds information about specific command of installed component

func (*InstalledComponentCommand) RunDocker

func (cc *InstalledComponentCommand) RunDocker(image string, workDirectory string, mounts map[string]string, processor func(string) string) error

func (*InstalledComponentCommand) String

func (cc *InstalledComponentCommand) String() string

The String method is used to pretty-print InstalledComponentCommand struct

type InstalledComponentVersion

type InstalledComponentVersion struct {
	EnvironmentRef uuid.UUID                   `yaml:"environment_ref"` //TODO try to remove it
	Name           string                      `yaml:"name"`
	Type           string                      `yaml:"type"`
	Version        string                      `yaml:"version"`
	Image          string                      `yaml:"image"`
	WorkDirectory  string                      `yaml:"workdir"`
	Mounts         []string                    `yaml:"mounts"`
	Shared         string                      `yaml:"shared"`
	Commands       []InstalledComponentCommand `yaml:"commands"`
}

InstalledComponentVersion struct holds information about installed components with its details.

func (*InstalledComponentVersion) Download

func (cv *InstalledComponentVersion) Download() error

func (*InstalledComponentVersion) PersistLogs

func (cv *InstalledComponentVersion) PersistLogs(logs string)

func (*InstalledComponentVersion) Run

func (cv *InstalledComponentVersion) Run(command string, processor func(string) string) error

func (*InstalledComponentVersion) String

func (cv *InstalledComponentVersion) String() string

The String method is used to pretty-print InstalledComponentVersion struct

type SshConfig

type SshConfig struct {
	RsaKeyPair auth.RsaKeyPair `yaml:"rsa-keypair"`
}

Jump to

Keyboard shortcuts

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