Documentation ¶
Overview ¶
Package saga implements saga orchestration logic.
Index ¶
Constants ¶
View Source
const ( CommandStart = "start" QueueName = "responses" StatusStarted = "started" StatusError = "error" StatusWorkDone = "done" StatusCompleted = "completed" )
Variables ¶
View Source
var ( ErrEndOfWorkflow = fmt.Errorf("end of workflow") ErrServiceNotFound = fmt.Errorf("service not found") )
View Source
var SampleWorkflow = []Service{ { "service1", "commands1", nil, }, { "service2", "commands2", nil, }, { "service3", "commands3", nil, }, }
Functions ¶
This section is empty.
Types ¶
type Saga ¶
type Saga struct {
// contains filtered or unexported fields
}
Saga contains the database for storing URLs.
func (Saga) ProcessMessage ¶
ProcessMessage receives a message with a response from a service and decides which service has to be called next according to the saga workflow.
type Storer ¶
type Storer interface { InsertSaga(context.Context, uuid.UUID, string, string) error UpdateStatus(context.Context, uuid.UUID, string) error UpdateService(context.Context, uuid.UUID, string, string) error }
Storer interface abstracts data access operations for persisting a saga.
Click to show internal directories.
Click to hide internal directories.