allocator

package
v0.10.3-0...-27c22d1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 5 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 {
	Start() error
	Close()
	AllocOne() (UniqueID, error)
	Alloc(count uint32) (UniqueID, UniqueID, error)
	GetGenerator(count int, done <-chan struct{}) (<-chan UniqueID, error)
	GetIDAlloactor() *gAllocator.IDAllocator
}

func New

func New(ctx context.Context, rootCoord types.RootCoordClient, peerID UniqueID) (Allocator, error)

type Impl

type Impl struct {
	// Start() error
	// Close() error
	// AllocOne() (UniqueID, error)
	// Alloc(count uint32) (UniqueID, UniqueID, error)
	*gAllocator.IDAllocator
}

func (*Impl) GetGenerator

func (a *Impl) GetGenerator(count int, done <-chan struct{}) (<-chan UniqueID, error)

func (*Impl) GetIDAlloactor

func (a *Impl) GetIDAlloactor() *gAllocator.IDAllocator

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) Alloc

func (_m *MockAllocator) Alloc(count uint32) (int64, int64, error)

Alloc provides a mock function with given fields: count

func (*MockAllocator) AllocOne

func (_m *MockAllocator) AllocOne() (int64, error)

AllocOne provides a mock function with given fields:

func (*MockAllocator) Close

func (_m *MockAllocator) Close()

Close provides a mock function with given fields:

func (*MockAllocator) EXPECT

func (_m *MockAllocator) EXPECT() *MockAllocator_Expecter

func (*MockAllocator) GetGenerator

func (_m *MockAllocator) GetGenerator(count int, done <-chan struct{}) (<-chan int64, error)

GetGenerator provides a mock function with given fields: count, done

func (*MockAllocator) GetIDAlloactor

func (_m *MockAllocator) GetIDAlloactor() *internalallocator.IDAllocator

GetIDAlloactor provides a mock function with given fields:

func (*MockAllocator) Start

func (_m *MockAllocator) Start() error

Start provides a mock function with given fields:

type MockAllocator_AllocOne_Call

type MockAllocator_AllocOne_Call struct {
	*mock.Call
}

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

func (*MockAllocator_AllocOne_Call) Return

func (*MockAllocator_AllocOne_Call) Run

func (*MockAllocator_AllocOne_Call) RunAndReturn

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

type MockAllocator_Alloc_Call

type MockAllocator_Alloc_Call struct {
	*mock.Call
}

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

func (*MockAllocator_Alloc_Call) Return

func (*MockAllocator_Alloc_Call) Run

func (_c *MockAllocator_Alloc_Call) Run(run func(count uint32)) *MockAllocator_Alloc_Call

func (*MockAllocator_Alloc_Call) RunAndReturn

func (_c *MockAllocator_Alloc_Call) RunAndReturn(run func(uint32) (int64, int64, error)) *MockAllocator_Alloc_Call

type MockAllocator_Close_Call

type MockAllocator_Close_Call struct {
	*mock.Call
}

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

func (*MockAllocator_Close_Call) Return

func (*MockAllocator_Close_Call) Run

func (*MockAllocator_Close_Call) RunAndReturn

func (_c *MockAllocator_Close_Call) RunAndReturn(run func()) *MockAllocator_Close_Call

type MockAllocator_Expecter

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

func (*MockAllocator_Expecter) Alloc

func (_e *MockAllocator_Expecter) Alloc(count interface{}) *MockAllocator_Alloc_Call

Alloc is a helper method to define mock.On call

  • count uint32

func (*MockAllocator_Expecter) AllocOne

AllocOne is a helper method to define mock.On call

func (*MockAllocator_Expecter) Close

Close is a helper method to define mock.On call

func (*MockAllocator_Expecter) GetGenerator

func (_e *MockAllocator_Expecter) GetGenerator(count interface{}, done interface{}) *MockAllocator_GetGenerator_Call

GetGenerator is a helper method to define mock.On call

  • count int
  • done <-chan struct{}

func (*MockAllocator_Expecter) GetIDAlloactor

GetIDAlloactor is a helper method to define mock.On call

func (*MockAllocator_Expecter) Start

Start is a helper method to define mock.On call

type MockAllocator_GetGenerator_Call

type MockAllocator_GetGenerator_Call struct {
	*mock.Call
}

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

func (*MockAllocator_GetGenerator_Call) Return

func (*MockAllocator_GetGenerator_Call) Run

func (_c *MockAllocator_GetGenerator_Call) Run(run func(count int, done <-chan struct{})) *MockAllocator_GetGenerator_Call

func (*MockAllocator_GetGenerator_Call) RunAndReturn

func (_c *MockAllocator_GetGenerator_Call) RunAndReturn(run func(int, <-chan struct{}) (<-chan int64, error)) *MockAllocator_GetGenerator_Call

type MockAllocator_GetIDAlloactor_Call

type MockAllocator_GetIDAlloactor_Call struct {
	*mock.Call
}

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

func (*MockAllocator_GetIDAlloactor_Call) Return

func (*MockAllocator_GetIDAlloactor_Call) Run

func (*MockAllocator_GetIDAlloactor_Call) RunAndReturn

type MockAllocator_Start_Call

type MockAllocator_Start_Call struct {
	*mock.Call
}

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

func (*MockAllocator_Start_Call) Return

func (*MockAllocator_Start_Call) Run

func (*MockAllocator_Start_Call) RunAndReturn

func (_c *MockAllocator_Start_Call) RunAndReturn(run func() error) *MockAllocator_Start_Call

type UniqueID

type UniqueID = typeutil.UniqueID

Jump to

Keyboard shortcuts

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