Documentation
¶
Overview ¶
Package mock provides an in-process, CGo-free implementation of the dds interfaces. All participants within the same process share a global in-memory broker: a Publisher.Write on topic T is delivered synchronously to every Subscriber.C() for topic T.
The mock is the default implementation used by unit tests. Switch to the rtps or cyclone package when a real DDS domain (multi-process, multi-host) is required.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶ added in v0.3.0
type Option func(*participant)
Option configures a mock participant.
func WithDeadlineCallback ¶ added in v0.3.0
WithDeadlineCallback registers fn to be called when a publisher has not written within its QoS.Deadline period.
func WithLivelinessCallback ¶ added in v0.4.0
func WithLivelinessCallback(fn func(dds.GUID, dds.LivelinessEvent)) Option
WithLivelinessCallback registers fn to be called when a participant is discovered or lost. In the mock, participants fire LivelinessGained on New and LivelinessLost on Close.
func WithLogger ¶ added in v0.4.0
WithLogger sets the structured logger used by this participant. Log output is zero-cost when l is nil.