# README
ActionKit Go SDK
This module contains helper and interfaces which will help you to implement actions using the action kit go api.
The module encapsulates the following technical aspects:
- JSON marshalling and unmarshalling of action inputs and outputs
- The sdk will wrap around your
describe
call and will provide some meaningful defaults for your endpoint definitions. - An additional layer of rollback stability. The SDK will keep a copy of your action state in memory to be able to roll back to the previous state in case of connections issues.
- Automatic handling of
file
parameters. The SDK will automatically download the file, store it in a temporary directory and delete the file after the action has stopped. TheConfig
-map inaction_kit_api.PrepareActionRequestBody
will contain the path to the downloaded file.
Installation
Add the following to your go.mod
file:
go get github.com/steadybit/action-kit/go/action_kit_sdk
Usage
-
Implement at least the
action_kit_sdk.Action
interface:- Examples:
-
Implement other interfaces if you need them:
action_kit_sdk.ActionWithStatus
action_kit_sdk.ActionWithStop
action_kit_sdk.ActionWithMetricQuery
-
Register your action:
action_kit_sdk.RegisterAction(NewRolloutRestartAction())
-
Add your registered actions to the index endpoint of your extension:
exthttp.RegisterHttpHandler("/actions", exthttp.GetterAsHandler(action_kit_sdk.GetActionList))
# Functions
ClearRegisteredActions clears all registered actions - used for testing.
GetActionList returns a list of all root endpoints of registered actions.
InstallSignalHandler registers a signal handler that stops all active actions on SIGINT, SIGTERM and SIGUSR1.
No description provided by the author
RegisterCoverageEndpoints registers two endpoints which get called by action_kit_test to retrieve coverage data.
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author