testutil

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockProvider added in v1.0.1

type MockProvider struct {
	Name_           string
	URL             string
	Bridged         []string
	Passthrough     []string
	InterceptorFunc func(w http.ResponseWriter, r *http.Request, tracer trace.Tracer) (intercept.Interceptor, error)
}

func (*MockProvider) AuthHeader added in v1.0.1

func (m *MockProvider) AuthHeader() string

func (*MockProvider) BaseURL added in v1.0.1

func (m *MockProvider) BaseURL() string

func (*MockProvider) BridgedRoutes added in v1.0.1

func (m *MockProvider) BridgedRoutes() []string

func (*MockProvider) CircuitBreakerConfig added in v1.0.1

func (m *MockProvider) CircuitBreakerConfig() *config.CircuitBreaker

func (*MockProvider) CreateInterceptor added in v1.0.1

func (m *MockProvider) CreateInterceptor(w http.ResponseWriter, r *http.Request, tracer trace.Tracer) (intercept.Interceptor, error)

func (*MockProvider) InjectAuthHeader added in v1.0.1

func (m *MockProvider) InjectAuthHeader(h *http.Header)

func (*MockProvider) Name added in v1.0.1

func (m *MockProvider) Name() string

func (*MockProvider) PassthroughRoutes added in v1.0.1

func (m *MockProvider) PassthroughRoutes() []string

func (*MockProvider) RoutePrefix added in v1.0.3

func (m *MockProvider) RoutePrefix() string

type MockRecorder

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

MockRecorder is a test implementation of aibridge.Recorder that captures all recording calls for test assertions.

func (*MockRecorder) RecordInterception

func (m *MockRecorder) RecordInterception(ctx context.Context, req *recorder.InterceptionRecord) error

func (*MockRecorder) RecordInterceptionEnded

func (m *MockRecorder) RecordInterceptionEnded(ctx context.Context, req *recorder.InterceptionRecordEnded) error

func (*MockRecorder) RecordPromptUsage

func (m *MockRecorder) RecordPromptUsage(ctx context.Context, req *recorder.PromptUsageRecord) error

func (*MockRecorder) RecordTokenUsage

func (m *MockRecorder) RecordTokenUsage(ctx context.Context, req *recorder.TokenUsageRecord) error

func (*MockRecorder) RecordToolUsage

func (m *MockRecorder) RecordToolUsage(ctx context.Context, req *recorder.ToolUsageRecord) error

func (*MockRecorder) RecordedInterceptions

func (m *MockRecorder) RecordedInterceptions() []*recorder.InterceptionRecord

RecordedInterceptions returns a copy of recorded interceptions in a thread-safe manner. Note: This is a shallow clone (see RecordedTokenUsages for details).

func (*MockRecorder) RecordedPromptUsages

func (m *MockRecorder) RecordedPromptUsages() []*recorder.PromptUsageRecord

RecordedPromptUsages returns a copy of recorded prompt usages in a thread-safe manner. Note: This is a shallow clone (see RecordedTokenUsages for details).

func (*MockRecorder) RecordedTokenUsages

func (m *MockRecorder) RecordedTokenUsages() []*recorder.TokenUsageRecord

RecordedTokenUsages returns a copy of recorded token usages in a thread-safe manner. Note: This is a shallow clone - the slice is copied but the pointers reference the same underlying records. This is sufficient for our test assertions which only read the data and don't modify the records.

func (*MockRecorder) RecordedToolUsages

func (m *MockRecorder) RecordedToolUsages() []*recorder.ToolUsageRecord

RecordedToolUsages returns a copy of recorded tool usages in a thread-safe manner. Note: This is a shallow clone (see RecordedTokenUsages for details).

func (*MockRecorder) ToolUsages

func (m *MockRecorder) ToolUsages() []*recorder.ToolUsageRecord

ToolUsages returns the raw toolUsages slice for direct field access in tests. Use RecordedToolUsages() for thread-safe access when assertions don't need direct field access.

func (*MockRecorder) VerifyAllInterceptionsEnded

func (m *MockRecorder) VerifyAllInterceptionsEnded(t *testing.T)

VerifyAllInterceptionsEnded verifies all recorded interceptions have been marked as completed.

Jump to

Keyboard shortcuts

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