Documentation ¶
Overview ¶
Package op implement dotfiles operations and reporting
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustPrintln ¶
func MustPrintln(res Result)
MustPrintln is like Println but panics in case of error
Types ¶
type LinkResult ¶
type LinkResult struct {
// contains filtered or unexported fields
}
LinkResult represent symlink's link operation result
func (*LinkResult) SourcePath ¶
func (res *LinkResult) SourcePath() string
SourcePath returns symlink's source path
func (*LinkResult) SourceState ¶
func (res *LinkResult) SourceState() *State
SourceState returns symlink's source state
func (*LinkResult) TargetPath ¶
func (res *LinkResult) TargetPath() string
TargetPath returns symlink's target path
func (*LinkResult) TargetState ¶
func (res *LinkResult) TargetState() *State
TargetState returns symlink's target state
type ReadResult ¶
type ReadResult struct {
// contains filtered or unexported fields
}
ReadResult represent symlink's read operation result
func (*ReadResult) SourcePath ¶
func (res *ReadResult) SourcePath() string
SourcePath returns symlink's source path
func (*ReadResult) SourceState ¶
func (res *ReadResult) SourceState() *State
SourceState returns symlink's source state
func (*ReadResult) TargetPath ¶
func (res *ReadResult) TargetPath() string
TargetPath returns symlink's target path
func (*ReadResult) TargetState ¶
func (res *ReadResult) TargetState() *State
TargetState returns symlink's target state
type Result ¶
type Result interface { TargetPath() string TargetState() *State SourcePath() string SourceState() *State }
Result represent symlink's operation result
type State ¶
type State struct {
// contains filtered or unexported fields
}
State represents possible target or source state
func NewCompleteState ¶
NewCompleteState returns State of `stateComplete`
func NewErrorState ¶
NewErrorState returns State of `stateError`
func NewIncompleteState ¶
NewIncompleteState returns State of `stateIncomplete`
func NewUnknownState ¶
NewUnknownState returns State of `stateUnknown`
func (*State) IsComplete ¶
IsComplete checks whether state is `stateComplete`
type UnlinkResult ¶
type UnlinkResult struct {
// contains filtered or unexported fields
}
UnlinkResult represent symlink's unlink operation result
func (*UnlinkResult) SourcePath ¶
func (res *UnlinkResult) SourcePath() string
SourcePath returns symlink's source path
func (*UnlinkResult) SourceState ¶
func (res *UnlinkResult) SourceState() *State
SourceState returns symlink's source state
func (*UnlinkResult) TargetPath ¶
func (res *UnlinkResult) TargetPath() string
TargetPath returns symlink's target path
func (*UnlinkResult) TargetState ¶
func (res *UnlinkResult) TargetState() *State
TargetState returns symlink's target state