Skip to content

Instantly share code, notes, and snippets.

@jimmyfielding
Last active July 28, 2020 12:19
Show Gist options
  • Save jimmyfielding/0093427f603a9249cda08600e6f0c1d5 to your computer and use it in GitHub Desktop.
Save jimmyfielding/0093427f603a9249cda08600e6f0c1d5 to your computer and use it in GitHub Desktop.
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) {
//emit slipstream event
},
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment