[docs] add Examples to each trigger/action

This commit is contained in:
2023-10-31 00:41:59 +01:00
parent 1466623070
commit cfb553c975
8 changed files with 98 additions and 6 deletions

View File

@@ -39,7 +39,21 @@ func (p Printer) GetName() string {
}
func (p Printer) GetDescription() string {
return "When triggered prints the configured message to stdout"
return `
Prints a given message to stdout.
This action is mostly used for debugging purposes.
`
}
func (p Printer) GetExample() string {
return `
{
type: "Print",
"options: {
"message": "Hello World!"
}
}
`
}
func (p Printer) GetOptions() []internal.ConfigOption {

View File

@@ -37,7 +37,15 @@ func (p Shutdown) GetName() string {
}
func (p Shutdown) GetDescription() string {
return "When triggered shuts down the machine"
return "Shutsdown the machine by perfoming a ```shutdown -h now```"
}
func (p Shutdown) GetExample() string {
return `
{
"type": "Shutdown",
}
`
}
func (p Shutdown) GetOptions() []internal.ConfigOption {

View File

@@ -40,7 +40,21 @@ func (p TimeOut) GetName() string {
}
func (p TimeOut) GetDescription() string {
return "When triggered waits given duration before continuing with next stage"
return `
Waits given duration in seconds.
This can be used to wait a certain amount of time before continuing to the next Stage
`
}
func (p TimeOut) GetExample() string {
return `
{
"type": "Timeout",
"options": {
"duration": 5
}
}
`
}
func (p TimeOut) GetOptions() []internal.ConfigOption {

View File

@@ -82,7 +82,18 @@ func (p Command) GetName() string {
}
func (p Command) GetDescription() string {
return "When triggered executes given command"
return "Invoces given command using exec."
}
func (p Command) GetExample() string {
return `
{
"type": "Command",
"options": {
"command": "srm /path/to/file"
}
}
`
}
func (p Command) GetOptions() []internal.ConfigOption {