Documentation ¶
Index ¶
- func ClearRegisteredActions()
- func GetActionList() action_kit_api.ActionList
- func InstallSignalHandler()
- func RegisterAction[T any](a Action[T])
- func RegisterCoverageEndpoints()
- func StopAction(ctx context.Context, executionId uuid.UUID, reason string)
- func StopAllActiveActions(reason string)
- type Action
- type ActionWithMetricQuery
- type ActionWithStatus
- type ActionWithStop
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearRegisteredActions ¶ added in v1.1.7
func ClearRegisteredActions()
ClearRegisteredActions clears all registered actions - used for testing. Warning: This will not remove the registered routes from the http server.
func GetActionList ¶
func GetActionList() action_kit_api.ActionList
GetActionList returns a list of all root endpoints of registered actions.
func InstallSignalHandler ¶ added in v1.0.2
func InstallSignalHandler()
InstallSignalHandler registers a signal handler that stops all active actions on SIGINT, SIGTERM and SIGUSR1.
func RegisterAction ¶
func RegisterCoverageEndpoints ¶ added in v1.1.3
func RegisterCoverageEndpoints()
RegisterCoverageEndpoints registers two endpoints which get called by action_kit_test to retrieve coverage data.
func StopAction ¶ added in v1.0.2
func StopAllActiveActions ¶
func StopAllActiveActions(reason string)
Types ¶
type Action ¶
type Action[T any] interface { // NewEmptyState creates a new empty state. A pointer to this state is passed to the other methods. NewEmptyState() T // Describe returns the action description. Describe() action_kit_api.ActionDescription // Prepare is called before the action is actually started. It is used to validate the action configuration and to prepare the action state. // [Details](https://github.com/steadybit/action-kit/blob/main/docs/action-api.md#preparation) Prepare(ctx context.Context, state *T, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error) // Start is called when the action should actually happen. // [Details](https://github.com/steadybit/action-kit/blob/main/docs/action-api.md#start) Start(ctx context.Context, state *T) (*action_kit_api.StartResult, error) }
type ActionWithMetricQuery ¶
type ActionWithMetricQuery[T any] interface { Action[T] // QueryMetrics is used to fetch metrics from the action. This method is required if the action supports a metric endpoint defined by [action_kit_api.MetricsConfiguration] in the [action_kit_api.ActionDe scription]. QueryMetrics(ctx context.Context, request action_kit_api.QueryMetricsRequestBody) (*action_kit_api.QueryMetricsResult, error) }
type ActionWithStatus ¶
type ActionWithStatus[T any] interface { Action[T] // Status is used to observe the current status of the action. This is called periodically by the action-kit if time control [action_kit_api.TimeControlInternal] or [action_kit_api.TimeControlExternal] is used. // [Details](https://github.com/steadybit/action-kit/blob/main/docs/action-api.md#status) Status(ctx context.Context, state *T) (*action_kit_api.StatusResult, error) }
type ActionWithStop ¶
type ActionWithStop[T any] interface { Action[T] // Stop is used to revert system modification or clean up any leftovers. This method is optional. // [Details](https://github.com/steadybit/action-kit/blob/main/docs/action-api.md#stop) Stop(ctx context.Context, state *T) (*action_kit_api.StopResult, error) }
Click to show internal directories.
Click to hide internal directories.