test

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package test provides mock implementations for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockMemoryProtector

type MockMemoryProtector struct {
	ExpectQuotaExceeded bool
	// contains filtered or unexported fields
}

MockMemoryProtector is a mock implementation of a memory protector.

func (*MockMemoryProtector) AcquireResource

func (f *MockMemoryProtector) AcquireResource(_ context.Context, _ uint64) error

AcquireResource simulates acquiring memory resources.

func (*MockMemoryProtector) AvailableBytes

func (f *MockMemoryProtector) AvailableBytes() int64

AvailableBytes returns a mocked available memory size.

func (*MockMemoryProtector) FlagSet

func (f *MockMemoryProtector) FlagSet() *run.FlagSet

FlagSet returns a new flag set for the mock memory protector.

func (*MockMemoryProtector) GetLimit

func (f *MockMemoryProtector) GetLimit() uint64

GetLimit returns the mocked memory limit.

func (*MockMemoryProtector) GracefulStop

func (f *MockMemoryProtector) GracefulStop()

GracefulStop simulates graceful shutdown.

func (*MockMemoryProtector) Name

func (f *MockMemoryProtector) Name() string

Name returns the name of the mock memory protector.

func (*MockMemoryProtector) PreRun

PreRun is a no-op setup for the mock.

func (*MockMemoryProtector) Serve

func (f *MockMemoryProtector) Serve() run.StopNotify

Serve immediately returns a closed stop channel.

func (*MockMemoryProtector) ShouldCache

func (f *MockMemoryProtector) ShouldCache(_ int64) bool

ShouldCache always returns false for testing.

func (*MockMemoryProtector) State

func (f *MockMemoryProtector) State() protector.State

State returns the mocked memory state.

func (*MockMemoryProtector) Validate

func (f *MockMemoryProtector) Validate() error

Validate validates the mock configuration.

Jump to

Keyboard shortcuts

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