Documentation ¶
Index ¶
- Constants
- Variables
- func IsPackage(path string) (bool, error)
- func LintImage(imageInspect types.ImageInspect, reportError func(error))
- type Addition
- type DecodeLabelError
- type DiffReporter
- type LabelError
- type Loader
- type MatchReason
- type MatchingPackage
- type Modification
- type NoEntrypointError
- type Package
- type PackageManager
- func (pm *PackageManager) FindByNameOrImage(packageNameOrImage string) ([]MatchingPackage, error)
- func (pm *PackageManager) ForceInstall(pkg *Package) error
- func (pm *PackageManager) HasInstallation(pkgName string) bool
- func (pm *PackageManager) Install(pkg *Package) error
- func (pm *PackageManager) List() (map[string]*Package, error)
- func (pm *PackageManager) Load(name string) (*Package, error)
- func (pm *PackageManager) Uninstall(packageName string) error
- type PermissionChangeReporter
- type Removal
- type StrictError
- type StructChange
- type UnknownLabelError
- type YamlLoader
Constants ¶
const (
DefaultWorkingDir = "/workdir"
)
Variables ¶
var (
DefaultLoader = YamlLoader{}
)
var ErrNotExhaustiveChangeTypeSwitch = errors.New("change type switch is not exhaustive this is likely a programming error")
Functions ¶
func LintImage ¶
func LintImage(imageInspect types.ImageInspect, reportError func(error))
Types ¶
type DecodeLabelError ¶
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 ¶
func (LabelError) Error ¶
func (e LabelError) Error() string
func (LabelError) Strict ¶
func (e LabelError) Strict() bool
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 ¶
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 (*Package) PreinstallMessage ¶
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 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