Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidOperation = errors.New("invalid operation")
ErrInvalidOperation is returned when an operation cannot be created from Input.
Functions ¶
func MakeErrInvalidOperation ¶
MakeErrInvalidOperation creates an error combining ErrInvalidOperation with the Input.
Types ¶
type Input ¶
type Input struct {
Name string `yaml:"name"`
Role string `yaml:"role"`
Shell string `yaml:"shell"`
Copy string `yaml:"copy"`
To string `yaml:"to"`
Backup bool `yaml:"backup"`
}
Input defines the YAML input structure for creating operations. It specifies the operation type (shell or copy) and its parameters.
type OpCopy ¶
type OpCopy struct {
// contains filtered or unexported fields
}
OpCopy copies files or directories to remote hosts via SFTP.
func NewOpCopy ¶
NewOpCopy creates a new OpCopy operation from the given Input. Returns ErrInvalidOperation if the To field is empty.
func (OpCopy) DefaultName ¶ added in v0.0.13
DefaultName returns the default name for copy operations.
type OpShell ¶
type OpShell struct {
// contains filtered or unexported fields
}
OpShell executes shell commands on remote hosts.
func NewOpShell ¶
NewOpShell creates a new OpShell operation from the given Input. Returns ErrInvalidOperation if Shell field is empty.
func (OpShell) DefaultName ¶ added in v0.0.13
DefaultName returns the default name for shell operations.
type Operation ¶
type Operation interface {
Execute(r *remote.Remote) (*gtypes.OrderedMap[string, string], error)
DefaultName() string
// contains filtered or unexported methods
}
Operation defines the interface for executable remote operations.
func GetOperation ¶
GetOperation creates an Operation from the given Input. It returns an error if the Input is invalid or unsupported.