inmemory

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWrappedInMemory

func NewWrappedInMemory(t *testing.T, fopts ...Option) pubsub.PubSub

Types

type Option

type Option func(*options)

Option is a function that configures the process.

func WithFeatures

func WithFeatures(features ...pubsub.Feature) Option

func WithPublishFn

func WithPublishFn(fn func(ctx context.Context, req *pubsub.PublishRequest) error) Option

type WrappedInMemory

type WrappedInMemory struct {
	pubsub.PubSub
	// contains filtered or unexported fields
}

Wrapped is a wrapper around inmemory pubsub to ensure that Init and Close are called only once.

func (*WrappedInMemory) Close

func (w *WrappedInMemory) Close() error

func (*WrappedInMemory) Features added in v1.18.0

func (w *WrappedInMemory) Features() []pubsub.Feature

Features overrides the embedded inmemory.PubSub's static feature list so test framework consumers can inject features via WithFeatures. Without this override the embedded PubSub's Features() would shadow w.features and WithFeatures would be silently ignored.

func (*WrappedInMemory) Init

func (w *WrappedInMemory) Init(ctx context.Context, metadata pubsub.Metadata) error

func (*WrappedInMemory) Publish

func (w *WrappedInMemory) Publish(ctx context.Context, req *pubsub.PublishRequest) error

Jump to

Keyboard shortcuts

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