Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeStringToBase64 ¶
EncodeStringToBase64 first checks if the string is encoded if yes returns it if no than encodes it.
Types ¶
type Action ¶
type Action interface { GetName() string ExecuteAction(input interface{}) (output interface{}, err error) }
Action is a named function which can be executed
type ActionCallContext ¶
type ActionCallContext struct { Action Action RemainingActions []Action Input interface{} TryToUndo bool }
ActionCallContext is context in which Actions can be executed
func NewActionCallContext ¶
func NewActionCallContext(action Action, remainingActions []Action, input interface{}, tryToUndoOnFail bool) *ActionCallContext
NewActionCallContext creates a new ActionCallContext
func (*ActionCallContext) OnCompleted ¶
func (ctx *ActionCallContext) OnCompleted(output interface{}) (interface{}, error)
OnCompleted is called back when an action has completed
func (*ActionCallContext) OnFailed ¶
func (ctx *ActionCallContext) OnFailed(error error)
OnFailed is called back when an action has failed
type ActionExecutor ¶
type ActionExecutor struct {
// contains filtered or unexported fields
}
ActionExecutor executes Actions
func NewActionExecutor ¶
func NewActionExecutor(log logrus.FieldLogger) *ActionExecutor
NewActionExecutor creates a new ActionExecutor
func (*ActionExecutor) ExecuteActions ¶
func (ae *ActionExecutor) ExecuteActions(actions []Action, input interface{}, tryToUndoOnFail bool) (output interface{}, err error)
ExecuteActions executes the defined Actions
type RevocableAction ¶
RevocableAction is an Action which can be revoked
Click to show internal directories.
Click to hide internal directories.