milvus/internal/mq/msgstream/mock_msgstream.go
jaime 039e9ce4bb
Refine msgstream interface (#20832)
Signed-off-by: yun.zhang <yun.zhang@zilliz.com>

Signed-off-by: yun.zhang <yun.zhang@zilliz.com>
2022-12-05 20:55:17 +08:00

21 lines
483 B
Go

package msgstream
type MockMsgStream struct {
MsgStream
AsProducerFunc func(channels []string)
BroadcastMarkFunc func(*MsgPack) (map[string][]MessageID, error)
BroadcastFunc func(*MsgPack) error
}
func NewMockMsgStream() *MockMsgStream {
return &MockMsgStream{}
}
func (m MockMsgStream) AsProducer(channels []string) {
m.AsProducerFunc(channels)
}
func (m MockMsgStream) Broadcast(pack *MsgPack) (map[string][]MessageID, error) {
return m.BroadcastMarkFunc(pack)
}