Documentation ¶
Index ¶
- Variables
- func CheckDockerConnectivity() error
- func NewDockerClient() (*client.Client, error)
- func NewInstallStepConditionError(condition string, err error) error
- func NewNoPackageAvailableForUpgradeError(pkgSpec string) error
- func NewNoServicesFoundError(pkgName string) error
- func NewPackageNotInstalledError(pkgName string, context string) error
- func NewPackageUninstallWouldBreakDepsError(uninstallPkgName string, uninstallPkgVersion string, dependentPkgName string, ...) error
- func NewResolverInstalledPackageNoMatchVersionSpecError(pkgName string, pkgVersion string, depSpec string) error
- func NewResolverNoAvailablePackage(pkgSpec string) error
- func NewResolverNoAvailablePackageDependencyError(depSpec string) error
- func NewResolverPackageAlreadyInstalledError(pkgName string) error
- func NewUnknownNetworkError(networkName string) error
- func RemoveDockerImage(imageName string) error
- type Config
- type Context
- type DockerService
- func (d *DockerService) Create() error
- func (d *DockerService) Logs(follow bool, tail string, stdoutWriter io.Writer, stderrWriter io.Writer) error
- func (d *DockerService) Remove() error
- func (d *DockerService) Running() (bool, error)
- func (d *DockerService) Start() error
- func (d *DockerService) Stop() error
- type InstalledPackage
- type Package
- type PackageInstallStep
- type PackageInstallStepDocker
- type PackageInstallStepFile
- type PackageManager
- func (p *PackageManager) ActiveContext() (string, Context)
- func (p *PackageManager) AddContext(name string, context Context) error
- func (p *PackageManager) AvailablePackages() []Package
- func (p *PackageManager) ContextEnv() map[string]string
- func (p *PackageManager) Contexts() map[string]Context
- func (p *PackageManager) DeleteContext(name string) error
- func (p *PackageManager) Down() error
- func (p *PackageManager) Info(pkgs ...string) error
- func (p *PackageManager) Install(pkgs ...string) error
- func (p *PackageManager) InstalledPackages() []InstalledPackage
- func (p *PackageManager) InstalledPackagesAllContexts() []InstalledPackage
- func (p *PackageManager) Logs(pkgName string, follow bool, tail string, stdoutWriter io.Writer, ...) error
- func (p *PackageManager) SetActiveContext(name string) error
- func (p *PackageManager) Uninstall(pkgName string, keepData bool, force bool) error
- func (p *PackageManager) Up() error
- func (p *PackageManager) UpdateContext(name string, context Context) error
- func (p *PackageManager) UpdatePackages() error
- func (p *PackageManager) Upgrade(pkgs ...string) error
- func (p *PackageManager) ValidatePackages() error
- type PackageOption
- type PackageOutput
- type Resolver
- type ResolverInstallSet
- type ResolverUpgradeSet
- type State
- type Template
Constants ¶
This section is empty.
Variables ¶
var ErrContainerAlreadyExists = errors.New("specified container already exists")
ErrContainerAlreadyExists is returned when creating a new container with a name that is already in use
var ErrContainerNotExists = errors.New("specified container does not exist")
ErrContainerNotExists is returned when querying a container by name that doesn't exist
var ErrContextAlreadyExists = errors.New("specified context already exists")
ErrContextAlreadyExists is returned when creating a context with a name that is already in use
var ErrContextInstallNoNetwork = errors.New("no network specified for context")
ErrContextInstallNoNetwork is returned when performing an install with no network specified on the active context
var ErrContextNoChangeNetwork = errors.New("cannot change the configured network for a context")
ErrContextNoChangeNetwork is returned when updating a context with a network different than what was previously configured
var ErrContextNoDeleteActive = errors.New("cannot delete active context")
ErrContextNoDeleteActive is returned when attempting to delete the active context
var ErrContextNotExist = errors.New("context does not exist")
ErrContextNotExist is returned when trying to selecting/managing a context that does not exist
var ErrMultipleInstallMethods = errors.New("only one install method may be specified in an install step")
ErrMultipleInstallMethods is returned when a package's install steps specify more than one install method on a single install step
var ErrNoInstallMethods = errors.New("no supported install method specified on install step")
ErrNoInstallMethods is returned when a package's install steps include an install step which has no recognized install method specified
var ErrNoRegistryConfigured = errors.New("no package registry is configured")
ErrNoRegistryConfigured is returned when no registry is configured
var ErrOperationFailed = errors.New("the operation has failed")
ErrOperationFailed is a placeholder error for operations that directly log errors. It's used to signify when an operation has failed when the actual error message is sent through the provided logger
var ErrValidationFailed = errors.New("validation failed")
ErrValidationFailed is returned when loading the package registry while doing package validation when a package failed to load
Functions ¶
func CheckDockerConnectivity ¶
func CheckDockerConnectivity() error
func NewDockerClient ¶
func NewNoServicesFoundError ¶
func NewResolverNoAvailablePackage ¶ added in v0.2.0
func NewUnknownNetworkError ¶
func RemoveDockerImage ¶
Types ¶
type Config ¶
type Config struct { BinDir string CacheDir string ConfigDir string ContextDir string DataDir string Logger *slog.Logger Template *Template RequiredPackageTags []string RegistryUrl string RegistryDir string }
func NewDefaultConfig ¶
type DockerService ¶
type DockerService struct { ContainerId string ContainerName string Image string Env map[string]string Command []string Args []string Binds []string Ports []string // contains filtered or unexported fields }
func NewDockerServiceFromContainerName ¶
func NewDockerServiceFromContainerName(containerName string, logger *slog.Logger) (*DockerService, error)
func (*DockerService) Create ¶
func (d *DockerService) Create() error
func (*DockerService) Remove ¶
func (d *DockerService) Remove() error
func (*DockerService) Running ¶
func (d *DockerService) Running() (bool, error)
func (*DockerService) Start ¶
func (d *DockerService) Start() error
func (*DockerService) Stop ¶
func (d *DockerService) Stop() error
type InstalledPackage ¶
type InstalledPackage struct { Package Package InstalledTime time.Time Context string PostInstallNotes string Options map[string]bool Outputs map[string]string }
func NewInstalledPackage ¶
func (InstalledPackage) IsEmpty ¶
func (i InstalledPackage) IsEmpty() bool
type Package ¶
type Package struct { Name string `yaml:"name,omitempty"` Version string `yaml:"version,omitempty"` Description string `yaml:"description,omitempty"` InstallSteps []PackageInstallStep `yaml:"installSteps,omitempty"` Dependencies []string `yaml:"dependencies,omitempty"` Tags []string `yaml:"tags,omitempty"` PreInstallScript string `yaml:"preInstallScript,omitempty"` PostInstallScript string `yaml:"postInstallScript,omitempty"` PreUninstallScript string `yaml:"preUninstallScript,omitempty"` PostUninstallScript string `yaml:"postUninstallScript,omitempty"` PostInstallNotes string `yaml:"postInstallNotes,omitempty"` Options []PackageOption `yaml:"options,omitempty"` Outputs []PackageOutput `yaml:"outputs,omitempty"` // contains filtered or unexported fields }
func NewPackageFromFile ¶
type PackageInstallStep ¶
type PackageInstallStep struct { Condition string `yaml:"condition,omitempty"` Docker *PackageInstallStepDocker `yaml:"docker,omitempty"` File *PackageInstallStepFile `yaml:"file,omitempty"` }
type PackageInstallStepDocker ¶
type PackageInstallStepDocker struct { ContainerName string `yaml:"containerName"` Image string `yaml:"image,omitempty"` Env map[string]string `yaml:"env,omitempty"` Command []string `yaml:"command,omitempty"` Args []string `yaml:"args,omitempty"` Binds []string `yaml:"binds,omitempty"` Ports []string `yaml:"ports,omitempty"` PullOnly bool `yaml:"pullOnly"` }
type PackageInstallStepFile ¶
type PackageManager ¶
type PackageManager struct {
// contains filtered or unexported fields
}
func NewDefaultPackageManager ¶
func NewDefaultPackageManager() (*PackageManager, error)
func NewPackageManager ¶
func NewPackageManager(cfg Config) (*PackageManager, error)
func (*PackageManager) ActiveContext ¶
func (p *PackageManager) ActiveContext() (string, Context)
func (*PackageManager) AddContext ¶
func (p *PackageManager) AddContext(name string, context Context) error
func (*PackageManager) AvailablePackages ¶
func (p *PackageManager) AvailablePackages() []Package
func (*PackageManager) ContextEnv ¶
func (p *PackageManager) ContextEnv() map[string]string
func (*PackageManager) Contexts ¶
func (p *PackageManager) Contexts() map[string]Context
func (*PackageManager) DeleteContext ¶
func (p *PackageManager) DeleteContext(name string) error
func (*PackageManager) Down ¶
func (p *PackageManager) Down() error
func (*PackageManager) Info ¶
func (p *PackageManager) Info(pkgs ...string) error
func (*PackageManager) Install ¶
func (p *PackageManager) Install(pkgs ...string) error
func (*PackageManager) InstalledPackages ¶
func (p *PackageManager) InstalledPackages() []InstalledPackage
func (*PackageManager) InstalledPackagesAllContexts ¶
func (p *PackageManager) InstalledPackagesAllContexts() []InstalledPackage
func (*PackageManager) SetActiveContext ¶
func (p *PackageManager) SetActiveContext(name string) error
func (*PackageManager) Uninstall ¶
func (p *PackageManager) Uninstall(pkgName string, keepData bool, force bool) error
func (*PackageManager) Up ¶
func (p *PackageManager) Up() error
func (*PackageManager) UpdateContext ¶
func (p *PackageManager) UpdateContext(name string, context Context) error
func (*PackageManager) UpdatePackages ¶ added in v0.2.0
func (p *PackageManager) UpdatePackages() error
func (*PackageManager) Upgrade ¶
func (p *PackageManager) Upgrade(pkgs ...string) error
func (*PackageManager) ValidatePackages ¶ added in v0.2.0
func (p *PackageManager) ValidatePackages() error
type PackageOption ¶
type PackageOutput ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func (*Resolver) Uninstall ¶
func (r *Resolver) Uninstall(pkgs ...InstalledPackage) error
type ResolverInstallSet ¶
type ResolverUpgradeSet ¶
type ResolverUpgradeSet struct { Installed InstalledPackage Upgrade Package Options map[string]bool }
type State ¶
type State struct { ActiveContext string Contexts map[string]Context InstalledPackages []InstalledPackage // contains filtered or unexported fields }
type Template ¶
type Template struct {
// contains filtered or unexported fields
}