Chore: Add AwaitHealthy to ModuleEngine and Server (#72215)
* Chore: Add AwaitHealthy to ModuleEngine and Server * switch from fmt.Errorf to errors.New Co-authored-by: Will Browne <wbrowne@users.noreply.github.com> --------- Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
co-authored by
Will Browne
parent
c7eb7fb58a
commit
4b95f611c2
+11
-3
@@ -27,9 +27,17 @@ func (m *MockModuleManager) RegisterInvisibleModule(name string, initFn func() (
|
||||
}
|
||||
|
||||
type MockModuleEngine struct {
|
||||
InitFunc func(context.Context) error
|
||||
RunFunc func(context.Context) error
|
||||
ShutdownFunc func(context.Context) error
|
||||
AwaitHealthyFunc func(context.Context) error
|
||||
InitFunc func(context.Context) error
|
||||
RunFunc func(context.Context) error
|
||||
ShutdownFunc func(context.Context) error
|
||||
}
|
||||
|
||||
func (m *MockModuleEngine) AwaitHealthy(ctx context.Context) error {
|
||||
if m.AwaitHealthyFunc != nil {
|
||||
return m.AwaitHealthyFunc(ctx)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MockModuleEngine) Init(ctx context.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user