mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 11:29:48 +08:00
6826964e60
Signed-off-by: xiaofan-luan <xiaofan.luan@zilliz.com> Signed-off-by: xiaofan-luan <xiaofan.luan@zilliz.com>
25 lines
514 B
Go
25 lines
514 B
Go
package allocator
|
|
|
|
type MockGIDAllocator struct {
|
|
Interface
|
|
AllocF func(count uint32) (UniqueID, UniqueID, error)
|
|
AllocOneF func() (UniqueID, error)
|
|
UpdateIDF func() error
|
|
}
|
|
|
|
func (m MockGIDAllocator) Alloc(count uint32) (UniqueID, UniqueID, error) {
|
|
return m.AllocF(count)
|
|
}
|
|
|
|
func (m MockGIDAllocator) AllocOne() (UniqueID, error) {
|
|
return m.AllocOneF()
|
|
}
|
|
|
|
func (m MockGIDAllocator) UpdateID() error {
|
|
return m.UpdateIDF()
|
|
}
|
|
|
|
func NewMockGIDAllocator() *MockGIDAllocator {
|
|
return &MockGIDAllocator{}
|
|
}
|