milvus/internal/proxy/mock_channels_mgr_test.go
Jiquan Long adf3b14027
Refine channels management in Proxy. (#17334)
Signed-off-by: longjiquan <jiquan.long@zilliz.com>
2022-06-02 15:34:04 +08:00

29 lines
686 B
Go

package proxy
type getVChannelsFuncType = func(collectionID UniqueID) ([]vChan, error)
type removeDMLStreamFuncType = func(collectionID UniqueID) error
type mockChannelsMgr struct {
channelsMgr
getVChannelsFuncType
removeDMLStreamFuncType
}
func (m *mockChannelsMgr) getVChannels(collectionID UniqueID) ([]vChan, error) {
if m.getVChannelsFuncType != nil {
return m.getVChannelsFuncType(collectionID)
}
return nil, nil
}
func (m *mockChannelsMgr) removeDMLStream(collectionID UniqueID) error {
if m.removeDMLStreamFuncType != nil {
return m.removeDMLStreamFuncType(collectionID)
}
return nil
}
func newMockChannelsMgr() *mockChannelsMgr {
return &mockChannelsMgr{}
}