stepfunctions

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Execution

type Execution struct {
	ExecutionArn    string
	StateMachineArn string
	Name            string
	Status          ExecutionStatus
	Input           string
	Output          string
	StartDate       time.Time
	StopDate        *time.Time
	Events          []HistoryEvent
}

Execution holds all metadata and history for a state machine execution.

type ExecutionStatus

type ExecutionStatus string

ExecutionStatus is the lifecycle state of an execution.

type HistoryEvent

type HistoryEvent struct {
	Timestamp       time.Time
	Type            string
	Id              int64
	PreviousEventId int64
}

HistoryEvent is a single event in an execution's history.

type StateMachine

type StateMachine struct {
	Arn          string
	Name         string
	Definition   string // ASL JSON string
	RoleArn      string
	Type         string // STANDARD | EXPRESS
	Status       StateMachineStatus
	CreationDate time.Time
	Tags         map[string]string
}

StateMachine holds all metadata for an AWS Step Functions state machine.

type StateMachineStatus

type StateMachineStatus string

StateMachineStatus is the lifecycle state of a state machine.

type StepFunctionsService

type StepFunctionsService struct {
	// contains filtered or unexported fields
}

StepFunctionsService is the cloudmock implementation of the AWS Step Functions API.

func New

func New(accountID, region string) *StepFunctionsService

New returns a new StepFunctionsService for the given AWS account ID and region.

func (*StepFunctionsService) Actions

func (s *StepFunctionsService) Actions() []service.Action

Actions returns the list of Step Functions API actions supported by this service.

func (*StepFunctionsService) HandleRequest

func (s *StepFunctionsService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes an incoming Step Functions request to the appropriate handler. Step Functions uses the JSON protocol; the action is parsed from X-Amz-Target by the gateway (e.g. "AWSStepFunctions.CreateStateMachine" → "CreateStateMachine").

func (*StepFunctionsService) HealthCheck

func (s *StepFunctionsService) HealthCheck() error

HealthCheck always returns nil (no external dependencies).

func (*StepFunctionsService) Name

func (s *StepFunctionsService) Name() string

Name returns the AWS service name used for routing. Step Functions uses "states" as the credential scope service name.

func (*StepFunctionsService) ResourceSchemas

func (s *StepFunctionsService) ResourceSchemas() []schema.ResourceSchema

ResourceSchemas returns the schema for Step Functions resource types.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is the in-memory store for Step Functions state machines and executions.

func NewStore

func NewStore(accountID, region string) *Store

NewStore creates an empty Step Functions Store.

func (*Store) CreateStateMachine

func (s *Store) CreateStateMachine(name, definition, roleArn, smType string, tags map[string]string) (*StateMachine, *service.AWSError)

CreateStateMachine creates a new state machine and returns it.

func (*Store) DeleteStateMachine

func (s *Store) DeleteStateMachine(arn string) *service.AWSError

DeleteStateMachine removes a state machine by ARN.

func (*Store) GetExecution

func (s *Store) GetExecution(execArn string) (*Execution, *service.AWSError)

GetExecution retrieves an execution by ARN.

func (*Store) GetExecutionHistory

func (s *Store) GetExecutionHistory(execArn string) ([]HistoryEvent, *service.AWSError)

GetExecutionHistory returns the events for an execution.

func (*Store) GetStateMachine

func (s *Store) GetStateMachine(arn string) (*StateMachine, *service.AWSError)

GetStateMachine retrieves a state machine by ARN.

func (*Store) ListExecutions

func (s *Store) ListExecutions(smArn string) ([]*Execution, *service.AWSError)

ListExecutions returns all executions for a given state machine ARN.

func (*Store) ListStateMachines

func (s *Store) ListStateMachines() []*StateMachine

ListStateMachines returns a snapshot of all state machines.

func (*Store) ListTagsForResource

func (s *Store) ListTagsForResource(resourceArn string) (map[string]string, *service.AWSError)

ListTagsForResource returns the tags for a state machine identified by ARN.

func (*Store) StartExecution

func (s *Store) StartExecution(smArn, execName, input string) (*Execution, *service.AWSError)

StartExecution creates a new execution for the given state machine and immediately marks it as SUCCEEDED with Output=Input (pass-through; real ASL execution is deferred).

func (*Store) StopExecution

func (s *Store) StopExecution(execArn, cause, errCode string) (*Execution, *service.AWSError)

StopExecution aborts an execution by ARN.

func (*Store) TagResource

func (s *Store) TagResource(resourceArn string, tags map[string]string) *service.AWSError

TagResource applies tags to a state machine identified by ARN.

func (*Store) UntagResource

func (s *Store) UntagResource(resourceArn string, tagKeys []string) *service.AWSError

UntagResource removes tags from a state machine identified by ARN.

func (*Store) UpdateStateMachine

func (s *Store) UpdateStateMachine(arn, definition, roleArn string) (*StateMachine, *service.AWSError)

UpdateStateMachine updates the definition and/or roleArn of a state machine.

Jump to

Keyboard shortcuts

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