Documentation
¶
Overview ¶
Package eventbustest provides shared test helpers for modulex.EventBus adapter implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBenchPayloadJSON ¶ added in v0.8.0
NewBenchPayloadJSON marshals NewBenchPayload, for benchmarks that publish or decode raw bytes.
Types ¶
type BenchPayload ¶ added in v0.8.0
type BenchPayload struct {
ID string `json:"id"`
Type string `json:"type"`
Timestamp int64 `json:"timestamp"`
Attempt int `json:"attempt"`
Metadata map[string]string `json:"metadata"`
}
BenchPayload is representative of a small event/message body: a handful of scalar fields plus one nested object, comparable in size to typical modulex EventBus payloads (~150-250 bytes encoded). It is shared by every adapter's benchmarks so cross-package throughput and JSON decode comparisons (see ADR-0034) measure the same fixed cost.
func NewBenchPayload ¶ added in v0.8.0
func NewBenchPayload() BenchPayload
NewBenchPayload returns the canonical BenchPayload value used across benchmarks.
type SyncBuffer ¶
type SyncBuffer struct {
// contains filtered or unexported fields
}
SyncBuffer is a concurrency-safe io.Writer wrapping a bytes.Buffer. It is useful for capturing log output written by adapter goroutines while the test polls the buffer from the main goroutine.
func (*SyncBuffer) String ¶
func (b *SyncBuffer) String() string