milvus/pkg/mq/msgstream/mock_mq_factory.go
XuanYang-cn 7f1ae35e72
Add timeout in dispatcher, AsConsumer and Seek (#26686)
See also: #25309

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
2023-09-08 09:51:17 +08:00

21 lines
436 B
Go

package msgstream
import "context"
type MockMqFactory struct {
Factory
NewMsgStreamFunc func(ctx context.Context) (MsgStream, error)
}
func NewMockMqFactory() *MockMqFactory {
return &MockMqFactory{}
}
func (m MockMqFactory) NewMsgStream(ctx context.Context) (MsgStream, error) {
return m.NewMsgStreamFunc(ctx)
}
func (m MockMqFactory) NewTtMsgStream(ctx context.Context) (MsgStream, error) {
return m.NewMsgStreamFunc(ctx)
}