testutil

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package testutil provides test doubles and helpers scoped to the configcore cell. It lives under internal/ to enforce the per-cell convention: other cells (auditcore, accesscore) that need similar test doubles should define their own internal/testutil rather than cross-cell-share, preserving the cell isolation boundary. If a truly cross-cell test utility emerges in the future, it should be elevated to cells/testutil/ or pkg/testutil/ — but that decision is deferred until the need is concrete.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailingPublisher

type FailingPublisher struct{ Err error }

FailingPublisher returns Err on every Publish call.

func (FailingPublisher) Close

func (FailingPublisher) Publish

func (f FailingPublisher) Publish(_ context.Context, _ string, _ []byte) error

type NoopTxRunner

type NoopTxRunner struct{ Calls int }

NoopTxRunner executes fn directly without a real transaction. Tracks call count.

func (*NoopTxRunner) RunInTx

func (s *NoopTxRunner) RunInTx(ctx context.Context, fn func(context.Context) error) error

type RecordingWriter

type RecordingWriter struct {
	Entries []outbox.Entry
	Err     error
}

RecordingWriter records outbox entries written to it. Set Err to simulate failures.

func (*RecordingWriter) Write

func (w *RecordingWriter) Write(_ context.Context, entry outbox.Entry) error

type StubPublisher

type StubPublisher struct{}

StubPublisher is a no-op outbox.Publisher for testing.

func (StubPublisher) Close

func (StubPublisher) Publish

func (StubPublisher) Publish(_ context.Context, _ string, _ []byte) error

Jump to

Keyboard shortcuts

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