Documentation
¶
Overview ¶
Package powerups implements various power-up types that process matched files and generate actions. Power-ups are responsible for determining what operations should be performed on matched files.
Index ¶
- Constants
- func GetBrewfileSentinelPath(pack string) string
- func GetInstallSentinelPath(pack string) string
- func NewBrewfilePowerUp() types.PowerUp
- func NewInstallScriptPowerUp() types.PowerUp
- func NewShellAddPathPowerUp() types.PowerUp
- func NewShellProfilePowerUp() types.PowerUp
- func RegisterBrewfilePowerUpFactory()
- func RegisterInstallScriptPowerUpFactory()
- type BinPowerUp
- type BrewfilePowerUp
- func (p *BrewfilePowerUp) Description() string
- func (p *BrewfilePowerUp) Name() string
- func (p *BrewfilePowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
- func (p *BrewfilePowerUp) RunMode() types.RunMode
- func (p *BrewfilePowerUp) ValidateOptions(options map[string]interface{}) error
- type InstallScriptPowerUp
- func (p *InstallScriptPowerUp) Description() string
- func (p *InstallScriptPowerUp) Name() string
- func (p *InstallScriptPowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
- func (p *InstallScriptPowerUp) RunMode() types.RunMode
- func (p *InstallScriptPowerUp) ValidateOptions(options map[string]interface{}) error
- type ShellAddPathPowerUp
- func (p *ShellAddPathPowerUp) Description() string
- func (p *ShellAddPathPowerUp) Name() string
- func (p *ShellAddPathPowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
- func (p *ShellAddPathPowerUp) RunMode() types.RunMode
- func (p *ShellAddPathPowerUp) ValidateOptions(options map[string]interface{}) error
- type ShellProfilePowerUp
- func (p *ShellProfilePowerUp) Description() string
- func (p *ShellProfilePowerUp) Name() string
- func (p *ShellProfilePowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
- func (p *ShellProfilePowerUp) RunMode() types.RunMode
- func (p *ShellProfilePowerUp) ValidateOptions(options map[string]interface{}) error
- type SymlinkPowerUp
- type TemplatePowerUp
- func (p *TemplatePowerUp) Description() string
- func (p *TemplatePowerUp) Name() string
- func (p *TemplatePowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
- func (p *TemplatePowerUp) RunMode() types.RunMode
- func (p *TemplatePowerUp) ValidateOptions(options map[string]interface{}) error
Constants ¶
const ( // BinPowerUpName is the unique name for the bin power-up BinPowerUpName = "bin" // BinPowerUpPriority is the priority for bin operations BinPowerUpPriority = 90 )
const ( SymlinkPowerUpName = "symlink" SymlinkPowerUpPriority = 100 )
const ( // TemplatePowerUpName is the unique name for the template power-up TemplatePowerUpName = "template" // TemplatePowerUpPriority is the priority for template operations TemplatePowerUpPriority = 70 )
const (
// BrewfilePowerUpName is the unique name for the Brewfile power-up
BrewfilePowerUpName = "brewfile"
)
const (
// InstallScriptPowerUpName is the unique name for the install script power-up
InstallScriptPowerUpName = "install_script"
)
const (
ShellAddPathPowerUpName = "shell_add_path"
)
const (
ShellProfilePowerUpName = "shell_profile"
)
Variables ¶
This section is empty.
Functions ¶
func GetBrewfileSentinelPath ¶
GetSentinelPath returns the path to the sentinel file for a pack
func GetInstallSentinelPath ¶
GetSentinelPath returns the path to the sentinel file for a pack
func NewBrewfilePowerUp ¶
NewBrewfilePowerUp creates a new instance of the Brewfile power-up
func NewInstallScriptPowerUp ¶
NewInstallScriptPowerUp creates a new instance of the install script power-up
func NewShellAddPathPowerUp ¶
NewShellAddPathPowerUp creates a new instance of the ShellAddPathPowerUp
func NewShellProfilePowerUp ¶
NewShellProfilePowerUp creates a new instance of the ShellProfilePowerUp
func RegisterBrewfilePowerUpFactory ¶
func RegisterBrewfilePowerUpFactory()
RegisterBrewfilePowerUpFactory registers the Brewfile power-up factory
func RegisterInstallScriptPowerUpFactory ¶
func RegisterInstallScriptPowerUpFactory()
RegisterInstallScriptPowerUpFactory registers the install script power-up factory
Types ¶
type BinPowerUp ¶
type BinPowerUp struct {
// contains filtered or unexported fields
}
BinPowerUp handles executable files by creating symlinks in ~/bin
func (*BinPowerUp) Description ¶
func (p *BinPowerUp) Description() string
Description returns a human-readable description
func (*BinPowerUp) Name ¶
func (p *BinPowerUp) Name() string
Name returns the unique name of this power-up
func (*BinPowerUp) Process ¶
func (p *BinPowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
Process takes executable files and creates symlink actions to ~/bin
func (*BinPowerUp) RunMode ¶
func (p *BinPowerUp) RunMode() types.RunMode
RunMode returns when this power-up should run
func (*BinPowerUp) ValidateOptions ¶
func (p *BinPowerUp) ValidateOptions(options map[string]interface{}) error
ValidateOptions checks if the provided options are valid
type BrewfilePowerUp ¶
type BrewfilePowerUp struct{}
BrewfilePowerUp processes Brewfiles to install packages via Homebrew
func (*BrewfilePowerUp) Description ¶
func (p *BrewfilePowerUp) Description() string
Description returns a human-readable description of what this power-up does
func (*BrewfilePowerUp) Name ¶
func (p *BrewfilePowerUp) Name() string
Name returns the unique name of this power-up
func (*BrewfilePowerUp) Process ¶
func (p *BrewfilePowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
Process takes Brewfile matches and generates brew actions
func (*BrewfilePowerUp) RunMode ¶
func (p *BrewfilePowerUp) RunMode() types.RunMode
RunMode returns whether this power-up runs once or many times
func (*BrewfilePowerUp) ValidateOptions ¶
func (p *BrewfilePowerUp) ValidateOptions(options map[string]interface{}) error
ValidateOptions checks if the provided options are valid for this power-up
type InstallScriptPowerUp ¶
type InstallScriptPowerUp struct{}
InstallScriptPowerUp runs install.sh scripts
func (*InstallScriptPowerUp) Description ¶
func (p *InstallScriptPowerUp) Description() string
Description returns a human-readable description of what this power-up does
func (*InstallScriptPowerUp) Name ¶
func (p *InstallScriptPowerUp) Name() string
Name returns the unique name of this power-up
func (*InstallScriptPowerUp) Process ¶
func (p *InstallScriptPowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
Process takes install script matches and generates install actions
func (*InstallScriptPowerUp) RunMode ¶
func (p *InstallScriptPowerUp) RunMode() types.RunMode
RunMode returns whether this power-up runs once or many times
func (*InstallScriptPowerUp) ValidateOptions ¶
func (p *InstallScriptPowerUp) ValidateOptions(options map[string]interface{}) error
ValidateOptions checks if the provided options are valid for this power-up
type ShellAddPathPowerUp ¶
type ShellAddPathPowerUp struct{}
ShellAddPathPowerUp manages adding directories to the PATH
func (*ShellAddPathPowerUp) Description ¶
func (p *ShellAddPathPowerUp) Description() string
func (*ShellAddPathPowerUp) Name ¶
func (p *ShellAddPathPowerUp) Name() string
func (*ShellAddPathPowerUp) Process ¶
func (p *ShellAddPathPowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
func (*ShellAddPathPowerUp) RunMode ¶
func (p *ShellAddPathPowerUp) RunMode() types.RunMode
func (*ShellAddPathPowerUp) ValidateOptions ¶
func (p *ShellAddPathPowerUp) ValidateOptions(options map[string]interface{}) error
type ShellProfilePowerUp ¶
type ShellProfilePowerUp struct{}
ShellProfilePowerUp manages shell profile modifications
func (*ShellProfilePowerUp) Description ¶
func (p *ShellProfilePowerUp) Description() string
func (*ShellProfilePowerUp) Name ¶
func (p *ShellProfilePowerUp) Name() string
func (*ShellProfilePowerUp) Process ¶
func (p *ShellProfilePowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
func (*ShellProfilePowerUp) RunMode ¶
func (p *ShellProfilePowerUp) RunMode() types.RunMode
func (*ShellProfilePowerUp) ValidateOptions ¶
func (p *ShellProfilePowerUp) ValidateOptions(options map[string]interface{}) error
type SymlinkPowerUp ¶
type SymlinkPowerUp struct {
// contains filtered or unexported fields
}
SymlinkPowerUp creates symbolic links from matched files to target locations
func NewSymlinkPowerUp ¶
func NewSymlinkPowerUp() *SymlinkPowerUp
NewSymlinkPowerUp creates a new SymlinkPowerUp with default target as user home
func (*SymlinkPowerUp) Description ¶
func (p *SymlinkPowerUp) Description() string
Description returns a human-readable description of what this power-up does
func (*SymlinkPowerUp) Name ¶
func (p *SymlinkPowerUp) Name() string
Name returns the unique name of this power-up
func (*SymlinkPowerUp) Process ¶
func (p *SymlinkPowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
Process takes a group of trigger matches and generates symlink actions
func (*SymlinkPowerUp) RunMode ¶
func (p *SymlinkPowerUp) RunMode() types.RunMode
RunMode returns whether this power-up runs once or many times
func (*SymlinkPowerUp) ValidateOptions ¶
func (p *SymlinkPowerUp) ValidateOptions(options map[string]interface{}) error
ValidateOptions checks if the provided options are valid for this power-up
type TemplatePowerUp ¶
type TemplatePowerUp struct {
// contains filtered or unexported fields
}
TemplatePowerUp processes template files and expands variables
func NewTemplatePowerUp ¶
func NewTemplatePowerUp() *TemplatePowerUp
NewTemplatePowerUp creates a new TemplatePowerUp
func (*TemplatePowerUp) Description ¶
func (p *TemplatePowerUp) Description() string
Description returns a human-readable description
func (*TemplatePowerUp) Name ¶
func (p *TemplatePowerUp) Name() string
Name returns the unique name of this power-up
func (*TemplatePowerUp) Process ¶
func (p *TemplatePowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)
Process takes template files and generates processed file actions
func (*TemplatePowerUp) RunMode ¶
func (p *TemplatePowerUp) RunMode() types.RunMode
RunMode returns when this power-up should run
func (*TemplatePowerUp) ValidateOptions ¶
func (p *TemplatePowerUp) ValidateOptions(options map[string]interface{}) error
ValidateOptions checks if the provided options are valid