saga

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destroy

func Destroy()

func Init

func Init(stateAPI *state.API, stateStoreName string, sagaName string)

Types

type Orchestrator

type Orchestrator struct {
	OutputFunc OutputFunc
	// contains filtered or unexported fields
}

func (*Orchestrator) AddStep

func (orchestrator *Orchestrator) AddStep(step *Step) *Orchestrator

func (*Orchestrator) Output

func (orchestrator *Orchestrator) Output(outputFunc OutputFunc) *Orchestrator

func (*Orchestrator) Rollback

func (orchestrator *Orchestrator) Rollback(startIndex int)

func (*Orchestrator) Run

func (orchestrator *Orchestrator) Run() (interface{}, error)

type OrchestratorState

type OrchestratorState struct {
	Name                string
	RollbackContextData string
	RollbackStartIndex  int
}

type OutputFunc

type OutputFunc func() (interface{}, error)

type Saga

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

func GetInstance

func GetInstance() *Saga

func (*Saga) BuildOrchestrator

func (s *Saga) BuildOrchestrator(orchestratorName string, rollbackRetryPeriodSec time.Duration) *Orchestrator

func (*Saga) GetOrchestratorNeedRollback

func (s *Saga) GetOrchestratorNeedRollback() ([]OrchestratorState, error)

type Step

type Step struct {
	StepFunc            StepFunc
	StepRollbackFunc    StepRollbackFunc
	RollbackContextData string
	// contains filtered or unexported fields
}

type StepFunc

type StepFunc func() error

type StepRollbackFunc

type StepRollbackFunc func() error

Jump to

Keyboard shortcuts

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