Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Noop = ActionFunc(func() error { return nil })
Functions ¶
func RollbackOnError ¶ added in v0.8.0
RollbackOnError is supposed to be used together with defer:
defer action.RollbackOnError(&err, action)
Then it is visible why *error is being passed in. The args are bound when this line is encountered, so it would not be set to a non-nil error in case the error is set later. That is why we pass a pointer so that err can be checked when the deferred function is actually called.
func RollbackTaskOnError ¶ added in v0.8.0
RollbackTaskOnError does the same thing as RollbackOnError, but it also informs the user that the given task is being reverted.
Types ¶
type ActionFunc ¶
type ActionFunc func() error
func (ActionFunc) Rollback ¶
func (action ActionFunc) Rollback() error
Click to show internal directories.
Click to hide internal directories.