action

package
v0.0.0-...-c510420 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package action defines and interface for action Manager. Action manager manages the execution of an action. The manager can list the objects on which the actions will be performed and can optionally perform a check to verify if the action succeeded, if required.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// GetName returns the name of the Manager based on the target object. This
	// is used to set unique name to help identify the manager, such as in the
	// logs by setting the logger name.
	GetName(interface{}) (string, error)

	// GetObjects returns all the objects on which action should be run.
	GetObjects(context.Context) ([]interface{}, error)

	// Check checks if the action is needed anymore.
	Check(context.Context, interface{}) (bool, error)

	// Run runs the action on the given object.
	Run(context.Context, interface{}) error

	// Defer is executed at the end of run to execute once run ends.
	Defer(context.Context, interface{}) error
}

Manager manages the actions to be executed on objects.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL