Documentation
¶
Overview ¶
Package pm is a generated GoMock package.
Package pm is a generated GoMock package.
Index ¶
- Variables
- func Encode(p *Process) ([]byte, error)
- type DefaultLogger
- type ErrorFunc
- type Event
- type FactoryFunc
- type Groups
- type Handler
- type HookFunc
- type Logger
- type Manager
- func (m *Manager) CancelProcess(ctx context.Context, pid uuid.UUID) error
- func (m *Manager) CreateProcess(ctx context.Context, pid uuid.UUID, pc ProcessContext) error
- func (m *Manager) ErrorHandler(handler ...ErrorFunc)
- func (m *Manager) OnCancel(hook ...HookFunc)
- func (m *Manager) OnFailure(hook ...HookFunc)
- func (m *Manager) OnSuccess(hook ...HookFunc)
- func (m *Manager) Run(ctx context.Context) error
- func (m *Manager) StartProcess(ctx context.Context, pid uuid.UUID) error
- func (m *Manager) Step(name string, fn FactoryFunc)
- func (m *Manager) SwitchProc(fn ...SwitchProcFunc)
- 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, kind string, pid uuid.UUID) (*Process, error)
- func (m *MockStore) Remove(ctx context.Context, pid uuid.UUID) error
- func (m *MockStore) Save(ctx context.Context, p *Process) error
- type MockStoreMockRecorder
- type ProcStatus
- type Process
- func (p *Process) CommandType() string
- 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) Kind() string
- func (p *Process) Make(payload interface{}) *es.Command
- func (p *Process) PID() uuid.UUID
- func (p *Process) Snapshot() Snapshot
- func (p *Process) State() ProcessContext
- func (p *Process) Status() ProcStatus
- func (p *Process) StatusName() string
- func (p *Process) Step() int
- func (p *Process) StreamType() string
- func (p *Process) UpdatedAt() time.Time
- type ProcessContext
- func (c ProcessContext) Copy() (copy ProcessContext, err error)
- func (c ProcessContext) Get(key string) interface{}
- func (c ProcessContext) GetBool(key string) (b bool)
- func (c ProcessContext) GetFloat(key string) (f float64)
- func (c ProcessContext) GetInt(key string) (i int)
- func (c ProcessContext) GetString(key string) (s string)
- func (c ProcessContext) Set(key string, value interface{})
- type Snapshot
- type Step
- type Store
- type SwitchProcFunc
- type Tx
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type DefaultLogger ¶
type DefaultLogger struct{}
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:"command"` 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 FactoryFunc ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) CancelProcess ¶
func (*Manager) CreateProcess ¶
func (*Manager) ErrorHandler ¶
func (*Manager) StartProcess ¶
func (*Manager) Step ¶
func (m *Manager) Step(name string, fn FactoryFunc)
func (*Manager) SwitchProc ¶
func (m *Manager) SwitchProc(fn ...SwitchProcFunc)
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, kind, 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 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 NewProcess ¶
func NewProcess(kind string, pid uuid.UUID, pc ProcessContext) *Process
func (*Process) CommandType ¶
func (*Process) IsCanceled ¶
func (*Process) IsProcessed ¶
func (*Process) IsProcessing ¶
func (*Process) IsRollback ¶
func (*Process) State ¶
func (p *Process) State() ProcessContext
func (*Process) Status ¶
func (p *Process) Status() ProcStatus
func (*Process) StatusName ¶
func (*Process) StreamType ¶
type ProcessContext ¶
type ProcessContext map[string]interface{}
func State ¶
func State() ProcessContext
func (ProcessContext) Copy ¶
func (c ProcessContext) Copy() (copy ProcessContext, err error)
func (ProcessContext) Get ¶
func (c ProcessContext) Get(key string) interface{}
func (ProcessContext) GetBool ¶
func (c ProcessContext) GetBool(key string) (b bool)
func (ProcessContext) GetFloat ¶
func (c ProcessContext) GetFloat(key string) (f float64)
func (ProcessContext) GetInt ¶
func (c ProcessContext) GetInt(key string) (i int)
func (ProcessContext) GetString ¶
func (c ProcessContext) GetString(key string) (s string)
func (ProcessContext) Set ¶
func (c ProcessContext) Set(key string, value interface{})
type SwitchProcFunc ¶
type SwitchProcFunc func(step Step)
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}