allocator

package
v0.10.3-0...-930112e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocator

type Allocator interface {
	AllocTimestamp(context.Context) (typeutil.Timestamp, error)
	AllocID(context.Context) (typeutil.UniqueID, error)
	AllocN(n int64) (typeutil.UniqueID, typeutil.UniqueID, error)
}

Allocator is the interface that allocating `UniqueID` or `Timestamp`

func NewRootCoordAllocator

func NewRootCoordAllocator(rootCoordClient types.RootCoordClient) Allocator

NewRootCoordAllocator gets an allocator from RootCoord

type MockAllocator

type MockAllocator struct {
	mock.Mock
}

MockAllocator is an autogenerated mock type for the Allocator type

func NewMockAllocator

func NewMockAllocator(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockAllocator

NewMockAllocator creates a new instance of MockAllocator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockAllocator) AllocID

func (_m *MockAllocator) AllocID(_a0 context.Context) (int64, error)

AllocID provides a mock function with given fields: _a0

func (*MockAllocator) AllocN

func (_m *MockAllocator) AllocN(n int64) (int64, int64, error)

AllocN provides a mock function with given fields: n

func (*MockAllocator) AllocTimestamp

func (_m *MockAllocator) AllocTimestamp(_a0 context.Context) (uint64, error)

AllocTimestamp provides a mock function with given fields: _a0

func (*MockAllocator) EXPECT

func (_m *MockAllocator) EXPECT() *MockAllocator_Expecter

type MockAllocator_AllocID_Call

type MockAllocator_AllocID_Call struct {
	*mock.Call
}

MockAllocator_AllocID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllocID'

func (*MockAllocator_AllocID_Call) Return

func (*MockAllocator_AllocID_Call) Run

func (*MockAllocator_AllocID_Call) RunAndReturn

type MockAllocator_AllocN_Call

type MockAllocator_AllocN_Call struct {
	*mock.Call
}

MockAllocator_AllocN_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllocN'

func (*MockAllocator_AllocN_Call) Return

func (*MockAllocator_AllocN_Call) Run

func (*MockAllocator_AllocN_Call) RunAndReturn

func (_c *MockAllocator_AllocN_Call) RunAndReturn(run func(int64) (int64, int64, error)) *MockAllocator_AllocN_Call

type MockAllocator_AllocTimestamp_Call

type MockAllocator_AllocTimestamp_Call struct {
	*mock.Call
}

MockAllocator_AllocTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllocTimestamp'

func (*MockAllocator_AllocTimestamp_Call) Return

func (*MockAllocator_AllocTimestamp_Call) Run

func (*MockAllocator_AllocTimestamp_Call) RunAndReturn

type MockAllocator_Expecter

type MockAllocator_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockAllocator_Expecter) AllocID

func (_e *MockAllocator_Expecter) AllocID(_a0 interface{}) *MockAllocator_AllocID_Call

AllocID is a helper method to define mock.On call

  • _a0 context.Context

func (*MockAllocator_Expecter) AllocN

func (_e *MockAllocator_Expecter) AllocN(n interface{}) *MockAllocator_AllocN_Call

AllocN is a helper method to define mock.On call

  • n int64

func (*MockAllocator_Expecter) AllocTimestamp

func (_e *MockAllocator_Expecter) AllocTimestamp(_a0 interface{}) *MockAllocator_AllocTimestamp_Call

AllocTimestamp is a helper method to define mock.On call

  • _a0 context.Context

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL