init
This commit is contained in:
31
internal/jobdef/sample_handler.go
Normal file
31
internal/jobdef/sample_handler.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package jobdef
|
||||
|
||||
import "context"
|
||||
|
||||
type SampleHandler struct{}
|
||||
|
||||
func (SampleHandler) Key() string {
|
||||
return "sample-handler"
|
||||
}
|
||||
|
||||
func (SampleHandler) Name() string {
|
||||
return "Sample Handler"
|
||||
}
|
||||
|
||||
func (SampleHandler) Description() string {
|
||||
return "Writes a sample startup log for scheduler plumbing."
|
||||
}
|
||||
|
||||
func (SampleHandler) Run(ctx context.Context, runtime Runtime, req ExecuteRequest) error {
|
||||
req.LogCollector.Appendf("sample handler executed: jobID=%s executionID=%s triggerType=%s", req.JobID, req.ExecutionID, req.TriggerType)
|
||||
runtime.Logger.Info(
|
||||
"sample handler executed",
|
||||
"jobID",
|
||||
req.JobID,
|
||||
"executionID",
|
||||
req.ExecutionID,
|
||||
"triggerType",
|
||||
req.TriggerType,
|
||||
)
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user