2021-04-27 08:32:47 +03:00
|
|
|
// Package flow is an interface used for saga pattern microservice workflow
|
2021-02-14 23:47:11 +03:00
|
|
|
package flow
|
|
|
|
|
|
|
|
type Step interface {
|
2021-04-27 08:32:47 +03:00
|
|
|
// Endpoint returns rpc endpoint service_name.service_method or broker topic
|
2021-02-14 23:47:11 +03:00
|
|
|
Endpoint() string
|
|
|
|
}
|
2021-04-27 08:32:47 +03:00
|
|
|
|
|
|
|
type Workflow interface {
|
|
|
|
Steps() [][]Step
|
|
|
|
Stop() error
|
|
|
|
}
|
|
|
|
|
|
|
|
type Flow interface {
|
|
|
|
Start(Workflow) error
|
|
|
|
Stop(Workflow)
|
|
|
|
}
|