Documentation ¶
Overview ¶
Package definitions is a generated GoMock package.
Package group is a generated GoMock package.
Index ¶
- Variables
- func Encode(p *Process) ([]byte, error)
- func Run(ctx context.Context, fns ...func(context.Context) error) error
- type Command
- type Context
- type ErrorFunc
- type Event
- type Group
- func (m *Group) Abort(ctx context.Context, pid PID) error
- func (m *Group) CancelProcess(ctx context.Context, pid PID) error
- func (m *Group) Close() error
- func (m *Group) CreateProcess(ctx context.Context, pid PID, pc ProcState) error
- func (m *Group) ErrorHandler(handler ...ErrorFunc)
- func (m *Group) NumSteps() int
- func (m *Group) OnCancel(hook ...HookFunc)
- func (m *Group) OnFailure(hook ...HookFunc)
- func (m *Group) OnSuccess(hook ...HookFunc)
- func (m *Group) OnSwitchProc(fn ...SwitchProcFunc)
- func (m *Group) Run(ctx context.Context) error
- func (m *Group) Start(ctx context.Context, pid PID, pc ProcState) error
- func (m *Group) StartProcess(ctx context.Context, pid PID) error
- func (m *Group) Stream(st stream.Type) *Step
- type Handler
- type HookFunc
- type InMemStore
- type Logger
- type Middleware
- type MockLogger
- type MockLoggerMockRecorder
- type MockStore
- func (m *MockStore) Append(ctx context.Context, p *Process) error
- func (m *MockStore) EXPECT() *MockStoreMockRecorder
- func (m *MockStore) Load(ctx context.Context, gt Type, pid PID) (*Process, error)
- func (m *MockStore) Remove(ctx context.Context, pid PID) error
- func (m *MockStore) Save(ctx context.Context, p *Process) error
- type MockStoreMockRecorder
- type Option
- type PID
- type Payload
- type ProcState
- func (c ProcState) Copy() (copy ProcState, err error)
- func (c ProcState) Get(key string) interface{}
- func (c ProcState) GetBool(key string) (b bool)
- func (c ProcState) GetFloat(key string) (f float64)
- func (c ProcState) GetInt(key string) (i int)
- func (c ProcState) GetString(key string) (s string)
- func (c ProcState) Set(key string, value interface{})
- type ProcStatus
- type Process
- func (p *Process) Command(payload interface{}) stream.Command
- func (p *Process) CommandType() stream.CommandType
- func (p *Process) Cursor() int
- func (p *Process) Err() error
- func (p *Process) IsCanceled() bool
- func (p *Process) IsFailed() bool
- func (p *Process) IsProcessed() bool
- func (p *Process) IsProcessing() bool
- func (p *Process) IsRollback() bool
- func (p *Process) PID() PID
- func (p *Process) Snapshot() Snapshot
- func (p *Process) State() ProcState
- func (p *Process) Status() ProcStatus
- func (p *Process) StatusName() string
- func (p *Process) StepNum() int
- func (p *Process) StreamType() stream.Type
- func (p *Process) Type() Type
- func (p *Process) UpdatedAt() time.Time
- type Snapshot
- type Step
- type Store
- type SwitchProcFunc
- type Type
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (Context) From ¶
func (ns Context) From() stream.CommandType
func (Context) To ¶
func (ns Context) To() stream.CommandType
type Event ¶
type Event struct { Message string `json:"message"` Kind string `json:"kind"` PID string `json:"pid"` Status int `json:"status"` IsRollback bool `json:"isRollback"` Cursor int `json:"cursor"` Command string `json:"codec"` Stream string `json:"stream"` Step int `json:"step"` Time time.Time `json:"time"` UpdatedAt time.Time `json:"updatedAt"` StatusName string `json:"statusName"` Context map[string]interface{} `json:"context"` Error string `json:"error"` }
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) CreateProcess ¶
func (*Group) ErrorHandler ¶
func (*Group) OnSwitchProc ¶
func (m *Group) OnSwitchProc(fn ...SwitchProcFunc)
type InMemStore ¶
type InMemStore struct {
// contains filtered or unexported fields
}
type MockLogger ¶
type MockLogger struct {
// contains filtered or unexported fields
}
MockLogger is a mock of Logger interface
func NewMockLogger ¶
func NewMockLogger(ctrl *gomock.Controller) *MockLogger
NewMockLogger creates a new mock instance
func (*MockLogger) Append ¶
func (m *MockLogger) Append(ctx context.Context, event Event)
Append mocks base method
func (*MockLogger) EXPECT ¶
func (m *MockLogger) EXPECT() *MockLoggerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockLoggerMockRecorder ¶
type MockLoggerMockRecorder struct {
// contains filtered or unexported fields
}
MockLoggerMockRecorder is the mock recorder for MockLogger
func (*MockLoggerMockRecorder) Append ¶
func (mr *MockLoggerMockRecorder) Append(ctx, event interface{}) *gomock.Call
Append indicates an expected call of Append
type MockStore ¶
type MockStore struct {
// contains filtered or unexported fields
}
MockStore is a mock of Store interface
func NewMockStore ¶
func NewMockStore(ctrl *gomock.Controller) *MockStore
NewMockStore creates a new mock instance
func (*MockStore) EXPECT ¶
func (m *MockStore) EXPECT() *MockStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockStoreMockRecorder ¶
type MockStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockStoreMockRecorder is the mock recorder for MockStore
func (*MockStoreMockRecorder) Append ¶
func (mr *MockStoreMockRecorder) Append(ctx, p interface{}) *gomock.Call
Append indicates an expected call of Append
func (*MockStoreMockRecorder) Load ¶
func (mr *MockStoreMockRecorder) Load(ctx, gt, pid interface{}) *gomock.Call
Load indicates an expected call of Load
func (*MockStoreMockRecorder) Remove ¶
func (mr *MockStoreMockRecorder) Remove(ctx, pid interface{}) *gomock.Call
Remove indicates an expected call of Remove
func (*MockStoreMockRecorder) Save ¶
func (mr *MockStoreMockRecorder) Save(ctx, p interface{}) *gomock.Call
Save indicates an expected call of Save
type PID ¶
func (PID) CorrelationID ¶
func (p PID) CorrelationID() stream.CorrelationID
type ProcStatus ¶
type ProcStatus int
const ( Init ProcStatus = 0 Processing ProcStatus = 1 Processed ProcStatus = 2 Failed ProcStatus = 3 Canceled ProcStatus = 4 Unknown ProcStatus = 5 )
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
func (*Process) CommandType ¶
func (p *Process) CommandType() stream.CommandType
func (*Process) IsCanceled ¶
func (*Process) IsProcessed ¶
func (*Process) IsProcessing ¶
func (*Process) IsRollback ¶
func (*Process) Status ¶
func (p *Process) Status() ProcStatus
func (*Process) StatusName ¶
func (*Process) StreamType ¶
type Store ¶
type Store interface { Append(ctx context.Context, p *Process) error Save(ctx context.Context, p *Process) error Remove(ctx context.Context, pid PID) error Load(ctx context.Context, gt Type, pid PID) (*Process, error) }
func NewInMemStore ¶
func NewInMemStore() Store
type SwitchProcFunc ¶
type SwitchProcFunc func(Context)