Documentation ¶
Overview ¶
Package action provides actions used in install
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CopyFileAction ¶
type CopyFileAction struct { // FromPathRel is the path where the file originated, relative to the "latest" // directory FromPathRel string // ToPath is the path where the file was written. ToPath string // FileCreated is a bool that records whether this action had to create a new file or not FileCreated bool // contains filtered or unexported fields }
CopyFileAction is an action that records a file being copied from FromPath to ToPath
func NewCopyFileAction ¶
func NewCopyFileAction(logger *zap.Logger, fromPathRel, toPath, backupDir string) (*CopyFileAction, error)
NewCopyFileAction creates a new CopyFileAction that indicates a file was copied from fromPathRel into toPath. backupDir is specified for rollback purposes. NOTE: This action MUST be created BEFORE the action actually takes place; This allows for previous existence of the file to be recorded.
func (CopyFileAction) Rollback ¶
func (c CopyFileAction) Rollback() error
Rollback will undo the file copy, by either deleting the file if the file did not originally exist, or it will copy the old file in the rollback dir if it already exists.
func (CopyFileAction) String ¶
func (c CopyFileAction) String() string
type RollbackableAction ¶
type RollbackableAction interface {
Rollback() error
}
RollbackableAction is an interface to represents an install action that may be rolled back.
type ServiceStartAction ¶
type ServiceStartAction struct {
// contains filtered or unexported fields
}
ServiceStartAction is an action that records that a service was started.
func NewServiceStartAction ¶
func NewServiceStartAction(svc service.Service) *ServiceStartAction
NewServiceStartAction creates a new ServiceStartAction
func (ServiceStartAction) Rollback ¶
func (s ServiceStartAction) Rollback() error
Rollback rolls back the start action (stops the service)
type ServiceStopAction ¶
type ServiceStopAction struct {
// contains filtered or unexported fields
}
ServiceStopAction is an action that records that a service was stopped.
func NewServiceStopAction ¶
func NewServiceStopAction(svc service.Service) *ServiceStopAction
NewServiceStopAction creates a new ServiceStopAction
func (ServiceStopAction) Rollback ¶
func (s ServiceStopAction) Rollback() error
Rollback rolls back the stop action (starts the service)
type ServiceUpdateAction ¶
type ServiceUpdateAction struct {
// contains filtered or unexported fields
}
ServiceUpdateAction is an action that records that a service was updated.
func NewServiceUpdateAction ¶
func NewServiceUpdateAction(logger *zap.Logger, installDir string) *ServiceUpdateAction
NewServiceUpdateAction creates a new ServiceUpdateAction
func (ServiceUpdateAction) Rollback ¶
func (s ServiceUpdateAction) Rollback() error
Rollback is an action that rolls back the service configuration to the one saved in the backup directory.