semaphore

package
v4.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package semaphore is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ISemaphore

type ISemaphore interface {
	AcquireMemoryWeight(ctx context.Context, weight int64) error
	ReleaseMemoryWeight(weight int64)
}

type MockISemaphore

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

MockISemaphore is a mock of ISemaphore interface.

func NewMockISemaphore

func NewMockISemaphore(ctrl *gomock.Controller) *MockISemaphore

NewMockISemaphore creates a new mock instance.

func (*MockISemaphore) AcquireMemoryWeight

func (m *MockISemaphore) AcquireMemoryWeight(ctx context.Context, weight int64) error

AcquireMemoryWeight mocks base method.

func (*MockISemaphore) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockISemaphore) ReleaseMemoryWeight

func (m *MockISemaphore) ReleaseMemoryWeight(weight int64)

ReleaseMemoryWeight mocks base method.

type MockISemaphoreMockRecorder

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

MockISemaphoreMockRecorder is the mock recorder for MockISemaphore.

func (*MockISemaphoreMockRecorder) AcquireMemoryWeight

func (mr *MockISemaphoreMockRecorder) AcquireMemoryWeight(ctx, weight any) *gomock.Call

AcquireMemoryWeight indicates an expected call of AcquireMemoryWeight.

func (*MockISemaphoreMockRecorder) ReleaseMemoryWeight

func (mr *MockISemaphoreMockRecorder) ReleaseMemoryWeight(weight any) *gomock.Call

ReleaseMemoryWeight indicates an expected call of ReleaseMemoryWeight.

type Semaphore

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

func NewSemaphore

func NewSemaphore() *Semaphore

func NewSemaphoreWithBudget

func NewSemaphoreWithBudget(b int64) *Semaphore

func (*Semaphore) AcquireMemoryWeight

func (s *Semaphore) AcquireMemoryWeight(ctx context.Context, weight int64) error

AcquireMemoryWeight acquires semaphore with a specified weight

func (*Semaphore) ReleaseMemoryWeight

func (s *Semaphore) ReleaseMemoryWeight(weight int64)

ReleaseMemoryWeight releases semaphore with a specified weight

Jump to

Keyboard shortcuts

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