add built in docu
This commit is contained in:
@@ -87,3 +87,10 @@ func NewAction(config []internal.ActionConfig) (Action, error) {
|
||||
return stagedActions, nil
|
||||
//return Action{}, fmt.Errorf("Error parsing config: Action with type %s does not exists", config.Type)
|
||||
}
|
||||
|
||||
func GetDocumenters() []internal.Documenter {
|
||||
return []internal.Documenter{
|
||||
Printer{},
|
||||
TimeOut{},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,3 +26,17 @@ func NewPrint(config internal.ActionConfig, c chan bool) (Action, error) {
|
||||
|
||||
return Printer{fmt.Sprintf("%v", message), c}, nil
|
||||
}
|
||||
|
||||
func (p Printer) GetName() string {
|
||||
return "Print"
|
||||
}
|
||||
|
||||
func (p Printer) GetDescription() string {
|
||||
return "When triggered prints the configured message to stdout"
|
||||
}
|
||||
|
||||
func (p Printer) GetOptions() []internal.ConfigOption {
|
||||
return []internal.ConfigOption{
|
||||
{"message", "string", "Message that should be printed", "\"\""},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,3 +28,17 @@ func NewTimeOut(config internal.ActionConfig, c chan bool) (Action, error) {
|
||||
|
||||
return TimeOut{time.Duration(duration.(float64)) * time.Second, c}, nil
|
||||
}
|
||||
|
||||
func (p TimeOut) GetName() string {
|
||||
return "TimeOut"
|
||||
}
|
||||
|
||||
func (p TimeOut) GetDescription() string {
|
||||
return "When triggered waits given duration before continuing with next stage"
|
||||
}
|
||||
|
||||
func (p TimeOut) GetOptions() []internal.ConfigOption {
|
||||
return []internal.ConfigOption{
|
||||
{"duration", "string", "duration in seconds", "0"},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user