keyneston / stepcompiler

An experimental attempt at compiling AWS Step Functions from Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Step Compiler

A mostly theoretical idea of being able to write and then compile AWS Step Functions from Golang.

Ideal

The ideal is to be able to build step functions in a bit more programmatic of a method. Being able to easily comment out states. Having it auto assemble which states are needed and skipping states that aren't. Additionally being able to use functions to "build" multiple states that are needed.

For example here is a meta-function that adds a pass state to set a status message. It then calls the error handling state which will use this status.

func WrapErrorHandling(state State, error State) State {
    newStatus := state.Name() + "Failed"
    intermediate := NewPass(newStatus).Result(
		map[string]interface{
		  "newStatus": newStatus,
    }).ResultPath("$.markFailure").Next(error)
	
	state.Next(intermediate)
	
	return state
}

About

An experimental attempt at compiling AWS Step Functions from Go


Languages

Language:Go 99.5%Language:Makefile 0.5%