mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 21:09:06 +08:00
039e9ce4bb
Signed-off-by: yun.zhang <yun.zhang@zilliz.com> Signed-off-by: yun.zhang <yun.zhang@zilliz.com>
21 lines
483 B
Go
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)
|
|
}
|