-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.go
More file actions
executable file
·46 lines (35 loc) · 800 Bytes
/
Copy pathplugin.go
File metadata and controls
executable file
·46 lines (35 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package msm
import (
"fmt"
"go.uber.org/zap"
)
type ErrorResponse struct {
Reason string
}
type PluginMockCB func(m IFSMManager, fi *FSMInstance, request RequestPayload)
type PluginMock struct {
Manager IFSMManager
cb PluginMockCB
name string
log *zap.Logger
}
func PluginMockNew(manager IFSMManager, name string, cb PluginMockCB, logger *zap.Logger) *PluginMock {
p := &PluginMock{
Manager: manager,
cb: cb,
name: name,
log: logger.Named(fmt.Sprintf("mock-%s", name)),
}
return p
}
func (p *PluginMock) AutoMigrate() error {
return nil
}
func (p *PluginMock) Name() string {
return p.name
}
func (p *PluginMock) Process(fi *FSMInstance, request RequestPayload) {
p.cb(p.Manager, fi, request)
}
func (p *PluginMock) Finish(fi *FSMInstance) {
}