Skip to content

Instantly share code, notes, and snippets.

fsm := fsm.NewFSM(
"request",
fsm.Events{
{Name: "new_image", Src: []string{"request"}, Dst: "start"},
{Name: "healthy_pods", Src: []string{"start", "stall"}, Dst: "success"},
{Name: "timeout_waiting", Src: []string{"start"}, Dst: "stall"},
{Name: "retire_image", Src: []string{"success"}, Dst: "retirement"},
},
fsm.Callbacks{
"enter_start": func(e *fsm.Event) {