mocks

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mocks is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockPipeline

func NewMockPipeline() *entity.Pipeline

NewMockPipeline creates a mock pipeline for testing

Types

type ExecutionMetrics

type ExecutionMetrics struct {
	TotalExecutions int64
	SuccessfulCalls int64
	FailedCalls     int64
	AverageLatency  time.Duration
	LastExecutedAt  time.Time
	P99Latency      time.Duration
	P95Latency      time.Duration
}

ExecutionMetrics represents execution statistics

type MockFunctionExecutor

type MockFunctionExecutor struct {
	ExecuteFunc      func(ctx context.Context, functionName string, input any) (any, error)
	ExecuteAsyncFunc func(ctx context.Context, functionName string, input any) (string, error)
	GetResultFunc    func(ctx context.Context, jobID string) (any, error)
	IsHealthyFunc    func(ctx context.Context) bool
	GetMetricsFunc   func(functionName string) (*ExecutionMetrics, error)

	Calls int
	// contains filtered or unexported fields
}

MockFunctionExecutor is a mock implementation of FunctionExecutor for testing

func (*MockFunctionExecutor) Execute

func (m *MockFunctionExecutor) Execute(ctx context.Context, functionName string, input any) (any, error)

func (*MockFunctionExecutor) ExecuteAsync

func (m *MockFunctionExecutor) ExecuteAsync(ctx context.Context, functionName string, input any) (string, error)

func (*MockFunctionExecutor) GetMetrics

func (m *MockFunctionExecutor) GetMetrics(functionName string) (*ExecutionMetrics, error)

func (*MockFunctionExecutor) GetResult

func (m *MockFunctionExecutor) GetResult(ctx context.Context, jobID string) (any, error)

func (*MockFunctionExecutor) IsHealthy

func (m *MockFunctionExecutor) IsHealthy(ctx context.Context) bool

type MockQueuePort

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

MockQueuePort is a mock of QueuePort interface.

func NewMockQueuePort

func NewMockQueuePort(ctrl *gomock.Controller) *MockQueuePort

NewMockQueuePort creates a new mock instance.

func (*MockQueuePort) Dequeue

func (m *MockQueuePort) Dequeue(ctx context.Context, priority entity.Priority) (*entity.Job, error)

Dequeue mocks base method.

func (*MockQueuePort) EXPECT

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

func (*MockQueuePort) Enqueue

func (m *MockQueuePort) Enqueue(ctx context.Context, job *entity.Job) error

Enqueue mocks base method.

func (*MockQueuePort) GetDepth

func (m *MockQueuePort) GetDepth(priority entity.Priority) int

GetDepth mocks base method.

func (*MockQueuePort) GetStats

func (m *MockQueuePort) GetStats() *port.QueueStats

GetStats mocks base method.

func (*MockQueuePort) Start

func (m *MockQueuePort) Start(ctx context.Context) error

Start mocks base method.

func (*MockQueuePort) Stop

func (m *MockQueuePort) Stop(ctx context.Context) error

Stop mocks base method.

type MockQueuePortMockRecorder

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

MockQueuePortMockRecorder is the mock recorder for MockQueuePort.

func (*MockQueuePortMockRecorder) Dequeue

func (mr *MockQueuePortMockRecorder) Dequeue(ctx, priority any) *gomock.Call

Dequeue indicates an expected call of Dequeue.

func (*MockQueuePortMockRecorder) Enqueue

func (mr *MockQueuePortMockRecorder) Enqueue(ctx, job any) *gomock.Call

Enqueue indicates an expected call of Enqueue.

func (*MockQueuePortMockRecorder) GetDepth

func (mr *MockQueuePortMockRecorder) GetDepth(priority any) *gomock.Call

GetDepth indicates an expected call of GetDepth.

func (*MockQueuePortMockRecorder) GetStats

func (mr *MockQueuePortMockRecorder) GetStats() *gomock.Call

GetStats indicates an expected call of GetStats.

func (*MockQueuePortMockRecorder) Start

func (mr *MockQueuePortMockRecorder) Start(ctx any) *gomock.Call

Start indicates an expected call of Start.

func (*MockQueuePortMockRecorder) Stop

func (mr *MockQueuePortMockRecorder) Stop(ctx any) *gomock.Call

Stop indicates an expected call of Stop.

type MockRuleEngine

type MockRuleEngine struct {
	EvaluateFunc func(ctx context.Context, data map[string]any) (map[string]any, []string, error)
	CompileFunc  func(ctx context.Context, rules []string) error

	Calls int
	// contains filtered or unexported fields
}

MockRuleEngine is a mock implementation of RuleEngine for testing

func (*MockRuleEngine) Compile

func (m *MockRuleEngine) Compile(ctx context.Context, rules []string) error

func (*MockRuleEngine) Evaluate

func (m *MockRuleEngine) Evaluate(ctx context.Context, data map[string]any) (map[string]any, []string, error)

type MockStageExecutor

type MockStageExecutor struct {
	Results map[string]any
	Errors  map[string]error
	Delays  map[string]int // milliseconds
	// contains filtered or unexported fields
}

MockStageExecutor provides controlled execution for testing

func NewMockStageExecutor

func NewMockStageExecutor() *MockStageExecutor

func (*MockStageExecutor) Execute

func (m *MockStageExecutor) Execute(ctx context.Context, stageName string, input any) (any, error)

func (*MockStageExecutor) SetDelay

func (m *MockStageExecutor) SetDelay(stageName string, delayMs int)

func (*MockStageExecutor) SetError

func (m *MockStageExecutor) SetError(stageName string, err error)

func (*MockStageExecutor) SetResult

func (m *MockStageExecutor) SetResult(stageName string, result any)

type MockTransformer

type MockTransformer struct {
	TransformFunc    func(ctx context.Context, name string, value any, params map[string]any) (any, error)
	CanTransformFunc func(name string) bool

	Calls int
	// contains filtered or unexported fields
}

MockTransformer is a mock implementation of Transformer for testing

func (*MockTransformer) CanTransform

func (m *MockTransformer) CanTransform(name string) bool

func (*MockTransformer) Transform

func (m *MockTransformer) Transform(ctx context.Context, name string, value any, params map[string]any) (any, error)

Jump to

Keyboard shortcuts

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