saga

package
v0.0.0-...-ed9d917 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	State         map[string]interface{}
	Type          string
	CorrelationId string
	IsCompleted   bool
	// contains filtered or unexported fields
}

func CreateContext

func CreateContext(store Store, session Session) *Context

func (*Context) Complete

func (ctx *Context) Complete()

Complete the saga

func (*Context) Done

func (ctx *Context) Done()

Commit changes and unlock saga

func (*Context) Save

func (ctx *Context) Save()

Save state to the saga

type Session

type Session interface {
	Commit() error
	Close()
}

type Store

type Store interface {
	SagaExists(correlationId string, sagaType string) (bool, error)
	RequestSaga(correlationId string, sagaType string) (*Context, error)
	CreateSaga(correlationId string, sagaType string) error
	UpdateState(session Session, correlationId string, sagaType string, state map[string]interface{}) error
	CompleteSaga(session Session, correlationId string, sagaType string) error
	DeleteSaga(correlationId string, sagaType string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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