packages

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWorkingDir = "/workdir"
)

Variables

View Source
var (
	DefaultLoader = YamlLoader{}
)
View Source
var ErrNotExhaustiveChangeTypeSwitch = errors.New("change type switch is not exhaustive this is likely a programming error")

Functions

func IsPackage

func IsPackage(path string) (bool, error)

IsPackage returns true if the given path is a whalebrew package

func LintImage

func LintImage(imageInspect types.ImageInspect, reportError func(error))

Types

type Addition

type Addition struct {
	AddedValue reflect.Value
	// contains filtered or unexported fields
}

func (Addition) FieldName

func (a Addition) FieldName() string

type DecodeLabelError

type DecodeLabelError struct {
	Err   error
	Value string
}

func (DecodeLabelError) Error

func (e DecodeLabelError) Error() string

func (DecodeLabelError) Strict

func (e DecodeLabelError) Strict() bool

type DiffReporter

type DiffReporter struct {
	// contains filtered or unexported fields
}

func NewDiffReporter

func NewDiffReporter() *DiffReporter

func (*DiffReporter) PopStep

func (r *DiffReporter) PopStep()

func (*DiffReporter) PushStep

func (r *DiffReporter) PushStep(ps cmp.PathStep)

func (*DiffReporter) Report

func (r *DiffReporter) Report(rs cmp.Result)

func (*DiffReporter) String

func (r *DiffReporter) String() string

type LabelError

type LabelError struct {
	Err   error
	Label string
}

func (LabelError) Error

func (e LabelError) Error() string

func (LabelError) Strict

func (e LabelError) Strict() bool

type Loader

type Loader interface {
	LoadPackageFromPath(path string) (*Package, error)
}

Loader loads a package from a given path

type MatchReason

type MatchReason string
const (
	MatchReasonPackageNameMatches  MatchReason = "package name matches"
	MatchReasonPackageImageMatches MatchReason = "package image matches"
)

type MatchingPackage

type MatchingPackage struct {
	Package
	Reason MatchReason
}

type Modification

type Modification struct {
	FieldType reflect.Type
	PrevValue reflect.Value
	CurrValue reflect.Value
	// contains filtered or unexported fields
}

func (Modification) FieldName

func (m Modification) FieldName() string

type NoEntrypointError

type NoEntrypointError struct {
}

func (NoEntrypointError) Error

func (e NoEntrypointError) Error() string

func (NoEntrypointError) Strict

func (e NoEntrypointError) Strict() bool

type Package

type Package struct {
	Name                string   `yaml:"-" labels:"name"`
	Entrypoint          []string `yaml:"entrypoint,omitempty"`
	Environment         []string `yaml:"environment,omitempty" labels:"config.environment"`
	Image               string   `yaml:"image"`
	Volumes             []string `yaml:"volumes,omitempty" labels:"config.volumes"`
	Ports               []string `yaml:"ports,omitempty" labels:"config.ports"`
	Networks            []string `yaml:"networks,omitempty" labels:"config.networks"`
	WorkingDir          string   `yaml:"working_dir,omitempty" labels:"config.working_dir"`
	KeepContainerUser   bool     `yaml:"keep_container_user,omitempty" labels:"config.keep_container_user"`
	SkipMissingVolumes  bool     `yaml:"skip_missing_volumes,omitempty"`
	MountMissingVolumes bool     `yaml:"mount_missing_volumes,omitempty"`
	RequiredVersion     string   `yaml:"required_version,omitempty" labels:"required_version"`
	PathArguments       []string `yaml:"path_arguments,omitempty" labels:"config.volumes_from_args"`
}

Package represents a Whalebrew package

func LoadPackageFromPath

func LoadPackageFromPath(path string) (*Package, error)

LoadPackageFromPath reads a package from the given path

func NewPackageFromImage

func NewPackageFromImage(image string, imageInspect types.ImageInspect) (*Package, error)

NewPackageFromImage creates a package from a given image name, inspecting the image to fetch the package configuration

func (*Package) HasChanges

func (pkg *Package) HasChanges(ctx context.Context, cli *client.Client) (bool, string, error)

func (*Package) PreinstallMessage

func (pkg *Package) PreinstallMessage(prevInstall *Package) string

PreinstallMessage returns the preinstall message for the package

type PackageManager

type PackageManager struct {
	InstallPath string
}

PackageManager manages packages at a given path

func NewPackageManager

func NewPackageManager(path string) *PackageManager

NewPackageManager creates a new PackageManager

func (*PackageManager) FindByNameOrImage

func (pm *PackageManager) FindByNameOrImage(packageNameOrImage string) ([]MatchingPackage, error)

func (*PackageManager) ForceInstall

func (pm *PackageManager) ForceInstall(pkg *Package) error

ForceInstall installs a package

func (*PackageManager) HasInstallation

func (pm *PackageManager) HasInstallation(pkgName string) bool

Looks at installation path for existing installation of pkgName

func (*PackageManager) Install

func (pm *PackageManager) Install(pkg *Package) error

Install installs a package

func (*PackageManager) List

func (pm *PackageManager) List() (map[string]*Package, error)

List lists installed packages

func (*PackageManager) Load

func (pm *PackageManager) Load(name string) (*Package, error)

Load returns an installed package given its package name

func (*PackageManager) Uninstall

func (pm *PackageManager) Uninstall(packageName string) error

Uninstall uninstalls a package

type PermissionChangeReporter

type PermissionChangeReporter struct {
	// contains filtered or unexported fields
}

func NewPermissionChangeReporter

func NewPermissionChangeReporter(freshInstall bool) *PermissionChangeReporter

func (*PermissionChangeReporter) PopStep

func (r *PermissionChangeReporter) PopStep()

func (*PermissionChangeReporter) PushStep

func (r *PermissionChangeReporter) PushStep(ps cmp.PathStep)

func (*PermissionChangeReporter) Report

func (r *PermissionChangeReporter) Report(rs cmp.Result)

func (*PermissionChangeReporter) String

func (r *PermissionChangeReporter) String() string

type Removal

type Removal struct {
	RemovedValue reflect.Value
	// contains filtered or unexported fields
}

func (Removal) FieldName

func (r Removal) FieldName() string

type StrictError

type StrictError interface {
	Strict() bool
}

type StructChange

type StructChange interface {
	FieldName() string
}

type UnknownLabelError

type UnknownLabelError struct {
	Label string
}

func (UnknownLabelError) Error

func (e UnknownLabelError) Error() string

func (UnknownLabelError) Strict

func (e UnknownLabelError) Strict() bool

type YamlLoader

type YamlLoader struct{}

YamlLoader reads a package stored as yaml

func (YamlLoader) LoadPackageFromPath

func (y YamlLoader) LoadPackageFromPath(path string) (*Package, error)

LoadPackageFromPath reads a package from the given path

Jump to

Keyboard shortcuts

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