rules

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Apply(*ActionContext) error
	Pprint()
}

type ActionContext added in v0.5.0

type ActionContext struct {
	KeyValueStore *shell.KeyValueStore
}

type Alias

type Alias struct {
	Alias   string
	Command string
}

func (Alias) Apply

func (a Alias) Apply(actx *ActionContext) error

TODO: remove code duplication with export.go

func (Alias) Pprint

func (a Alias) Pprint()

type Delete

type Delete struct {
	Path string
}

func (Delete) Apply

func (d Delete) Apply(actx *ActionContext) error

func (Delete) Pprint

func (d Delete) Pprint()

type Export

type Export struct {
	Key   string
	Value string
}

func (Export) Apply

func (e Export) Apply(actx *ActionContext) error

func (Export) Pprint

func (e Export) Pprint()

type Migrate

type Migrate struct {
	Source  string
	Dest    string
	Symlink bool
}

func (Migrate) Apply

func (m Migrate) Apply(actx *ActionContext) error

func (Migrate) Pprint

func (m Migrate) Pprint()

type MissingRulesFile

type MissingRulesFile struct{}

func (*MissingRulesFile) Error

func (e *MissingRulesFile) Error() string

type Rule

type Rule struct {
	Name        string
	Description string
	Dotfile     *dotfile.Dotfile
	Ignore      bool
	Actions     []Action
	Notes       []string
}

func MatchRule

func MatchRule(dotfile *dotfile.Dotfile) *Rule

func (Rule) Apply

func (r Rule) Apply(actx *ActionContext)

TODO: return the error

func (Rule) Pprint

func (r Rule) Pprint()

type RulesConfig

type RulesConfig struct {
	Version int
	Rules   []Rule
}

func LoadRulesConfig

func LoadRulesConfig(filepath string) (RulesConfig, error)

TODO: return a pointer to RulesConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL