Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
Action models a "doable" and potentially "undoable" action.
If an action can be undone, its Undoable member is to return true, otherwise false. Iff Undoable returns false, Undo should be a no-op.
Actions can also -- e.g. for the purposes of help generation -- be described by Explain. Explain is to return a string describing the action Do would perform.
type Simple ¶
type Simple struct {
// contains filtered or unexported fields
}
Simple implements the Action interface. It models a simple, non-undoable action as a func() which is called on Do.
func NewSimple ¶
NewSimple returns a pointer to a new simple action, which stores the given action function and the given explainer to use when prompted with Do or Explain respectively.
func (*Simple) Do ¶
func (a *Simple) Do()
Do performs this simple action. A simple action is not undoable.