Documentation ¶
Index ¶
- Variables
- type DotFile
- func (df *DotFile) CurrentState() *State
- func (df *DotFile) Delete() error
- func (df *DotFile) IsFromThisHost() bool
- func (df *DotFile) IsGeneric() bool
- func (df *DotFile) IsLinked() bool
- func (df *DotFile) IsReadyToBeStored() bool
- func (df *DotFile) IsStored() bool
- func (df *DotFile) Link() error
- func (df *DotFile) MustBeCopied() bool
- func (df *DotFile) Restore() error
- func (df *DotFile) Store() error
- type FailError
- type SkipError
- type State
Constants ¶
This section is empty.
Variables ¶
var ( Linked = State("linked") NotLinked = State("not linked") Conflict = State("conflict") Missing = State("missing") )
States DotFile can be in.
Functions ¶
This section is empty.
Types ¶
type DotFile ¶
DotFile type represents a single dotfile, defined by its storage and linking location. If dotfile is stored, its StoredLocation corresponds to a file within dotfiles repository and OriginalLocation - to symlink in user home directory where system expects original file to be.
func (*DotFile) CurrentState ¶
CurrentState returns State object representing a state DotFile is currently in.
func (*DotFile) Delete ¶
Delete removes stored file and link to it from home dir, fails if file is not linked properly.
func (*DotFile) IsFromThisHost ¶
IsFromThisHost returns true if dotfile is specific to current host, false otherwise.
func (*DotFile) IsGeneric ¶
IsGeneric returns true if dotfile is not specific to any host, false otherwise.
func (*DotFile) IsLinked ¶
IsLinked returns true if file is stored and linked to it's original location, false otherwise.
func (*DotFile) IsReadyToBeStored ¶
IsReadyToBeStored returns true if dotfile is ready to be stored, that is if it is a regular file not conflicting with any of already stored files.
func (*DotFile) MustBeCopied ¶
MustBeCopied returns true if dotfile can not be symlinked and must be copied to appropriate place instead.
type State ¶
type State string
State represents current state of DotFile.
func (*State) ColorString ¶
ColorString generates ansi-colored representation of given State object.