Add finish context to mockengine

This commit is contained in:
lash 2025-01-19 09:08:03 +00:00
parent 975720919c
commit 37973a6c9b
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -10,7 +10,7 @@ type MockEngine struct {
InitFunc func(context.Context) (bool, error) InitFunc func(context.Context) (bool, error)
ExecFunc func(context.Context, []byte) (bool, error) ExecFunc func(context.Context, []byte) (bool, error)
FlushFunc func(context.Context, io.Writer) (int, error) FlushFunc func(context.Context, io.Writer) (int, error)
FinishFunc func() error FinishFunc func(context.Context) error
} }
func (m *MockEngine) Init(ctx context.Context) (bool, error) { func (m *MockEngine) Init(ctx context.Context) (bool, error) {
@ -25,6 +25,6 @@ func (m *MockEngine) Flush(ctx context.Context, w io.Writer) (int, error) {
return m.FlushFunc(ctx, w) return m.FlushFunc(ctx, w)
} }
func (m *MockEngine) Finish() error { func (m *MockEngine) Finish(ctx context.Context) error {
return m.FinishFunc() return m.FinishFunc(ctx)
} }