aslconv

package module
v0.0.0-...-c92b32b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 17 Imported by: 0

README

aslconv

ASL (Amazon States Language) converter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListFormat

func ListFormat(w io.Writer)

Types

type AmazonStatesLanguage

type AmazonStatesLanguage struct {
	Version        *string `hcl:"version"`
	Comment        *string `hcl:"comment"`
	StartAt        string  `hcl:"start_at"`
	TimeoutSeconds *int64  `hcl:"timeout_seconds"`
	States         States  `hcl:"state,block"`
}

https://states-language.net/spec.html#toplevelfields

func LoadASLWithBytes

func LoadASLWithBytes(data []byte, path string, optFns ...func(*LoadOptions)) (*AmazonStatesLanguage, error)

func LoadASLWithPath

func LoadASLWithPath(path string, optFns ...func(*LoadOptions)) (*AmazonStatesLanguage, error)

func LoadASLWithReader

func LoadASLWithReader(reader io.Reader, formatName string, optFns ...func(*LoadOptions)) (*AmazonStatesLanguage, error)

func (*AmazonStatesLanguage) DecodeBody

func (top *AmazonStatesLanguage) DecodeBody(body hcl.Body, ctx *hcl.EvalContext) hcl.Diagnostics

func (*AmazonStatesLanguage) EncodeBody

func (top *AmazonStatesLanguage) EncodeBody(body *hclwrite.Body) error

func (*AmazonStatesLanguage) MarshalDOT

func (top *AmazonStatesLanguage) MarshalDOT(graphName string, optFns ...func(*MarshalDOTOptions)) (string, error)

func (*AmazonStatesLanguage) MarshalJSON

func (top *AmazonStatesLanguage) MarshalJSON() ([]byte, error)

func (*AmazonStatesLanguage) UnmarshalJSON

func (top *AmazonStatesLanguage) UnmarshalJSON(bs []byte) error

type Format

type Format int
const (
	FormatJSON Format = iota
	FormatHCL
	FormatDOT
)

func DetectFormat

func DetectFormat(path string) (Format, error)

func Formats

func Formats() []Format

func GetFormat

func GetFormat(name string) (Format, bool)

func (Format) Exts

func (f Format) Exts() []string

func (Format) LoadASLWithBytes

func (f Format) LoadASLWithBytes(data []byte, path string, optFns ...func(*LoadOptions)) (*AmazonStatesLanguage, error)

func (Format) LoadASLWithPath

func (f Format) LoadASLWithPath(path string, optFns ...func(*LoadOptions)) (*AmazonStatesLanguage, error)

func (Format) LoadASLWithReader

func (f Format) LoadASLWithReader(reader io.Reader, optFns ...func(*LoadOptions)) (*AmazonStatesLanguage, error)

func (Format) String

func (f Format) String() string

func (Format) WriteASL

func (f Format) WriteASL(writer io.Writer, asl *AmazonStatesLanguage) error

type LoadOptions

type LoadOptions struct {
	HCLEvalContext                 *hcl.EvalContext
	HCLDiagnosticWriterInitializer func(*hclparse.Parser) hcl.DiagnosticWriter
}

type MarshalDOTOptions

type MarshalDOTOptions struct {
	PrepareGraph          func(*gographviz.Graph) error
	TerminalNodeAttrs     func() map[string]string
	StateNodeAttrs        func(*State) map[string]string
	EdgeAttrs             func(label string) map[string]string
	ChoiceEdgeAttrs       func(condition map[string]interface{}, i int) map[string]string
	BranchesSubGraphAttrs func(*State) map[string]string
	IteratorSubGraphAttrs func(*State) map[string]string
}

type RawMessage

type RawMessage json.RawMessage

func (RawMessage) MarshalJSON

func (m RawMessage) MarshalJSON() ([]byte, error)

func (*RawMessage) UnmarshalJSON

func (m *RawMessage) UnmarshalJSON(data []byte) error

type RawMessages

type RawMessages []RawMessage

type State

type State struct {
	Type           string                  `json:"Type,omitempty" hcl:"type,label"`
	Name           string                  `json:"-" hcl:"name,label"`
	Comment        *string                 `json:"Comment,omitempty" hcl:"comment"`
	Resource       *string                 `json:"Resource,omitempty" hcl:"resource"`
	Default        *string                 `json:"Default,omitempty" hcl:"default"`
	Seconds        *int64                  `json:"Seconds,omitempty" hcl:"seconds"`
	MaxConcurrency *int64                  `json:"MaxConcurrency,omitempty" hcl:"max_concurrency"`
	Next           *string                 `json:"Next,omitempty" hcl:"next"`
	ItemsPath      *string                 `json:"ItemsPath,omitempty" hcl:"items_path"`
	InputPath      *string                 `json:"InputPath,omitempty" hcl:"input_path"`
	OutputPath     *string                 `json:"OutputPath,omitempty" hcl:"output_path"`
	ResultPath     *string                 `json:"ResultPath,omitempty" hcl:"result_path"`
	End            *bool                   `json:"End,omitempty" hcl:"end"`
	Error          *string                 `json:"Error,omitempty" hcl:"error"`
	Cause          *string                 `json:"Cause,omitempty" hcl:"cause"`
	Retry          RawMessages             `json:"Retry,omitempty" hcl:"retry,optional"`
	Catch          RawMessages             `json:"Catch,omitempty" hcl:"catch,optional"`
	Parameters     RawMessage              `json:"Parameters,omitempty" hcl:"parameters,optional"`
	Result         RawMessage              `json:"Result,omitempty" hcl:"result,optional"`
	ResultSelector RawMessage              `json:"ResultSelector,omitempty" hcl:"result_selector,optional"`
	Choices        RawMessages             `json:"Choices,omitempty" hcl:"choices,optional"`
	Branches       []*AmazonStatesLanguage `json:"Branches,omitempty" hcl:"branch,block"`
	Iterator       *AmazonStatesLanguage   `json:"Iterator,omitempty" hcl:"iterator,block"`
}

func (*State) EncodeAsBlock

func (state *State) EncodeAsBlock(states States) (*hclwrite.Block, error)

type States

type States []*State

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL