Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HookCommand ¶
HookCommand sets a new command that will be run on specified event type. Only one command can be configured for each event type.
func NewHook ¶
NewHook creates new exec hook with specified commands.
Example ¶
package main import ( "log" "os" "github.com/allegro/mesos-executor/hook" "github.com/allegro/mesos-executor/hook/exec" ) func main() { os.Setenv("TEST", "test") defer os.Unsetenv("TEST") h := exec.NewHook(exec.HookCommand(hook.AfterTaskHealthyEvent, "sh", "-c", "echo $TEST")) if _, err := h.HandleEvent(hook.Event{Type: hook.AfterTaskHealthyEvent}); err != nil { log.Fatal(err) } }
Output: test
Types ¶
Click to show internal directories.
Click to hide internal directories.