Documentation ¶
Index ¶
- Variables
- func WithBehavior(behavior Behavior) func(*Multiplexer) *Multiplexer
- func WithConfig(cfg *Config) func(*Multiplexer) *Multiplexer
- func WithDestination(destination publishers.Publisher) func(*Multiplexer) *Multiplexer
- func WithLimit(limit int) func(*Multiplexer) *Multiplexer
- func WithReadOnly() func(*Multiplexer) *Multiplexer
- func WithReadWrite() func(*Multiplexer) *Multiplexer
- func WithSource(source subscribers.Subscriber) func(*Multiplexer) *Multiplexer
- func WithWriteOnly() func(*Multiplexer) *Multiplexer
- type Behavior
- type Config
- type Multiplexer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMarshallingMessage is returned when an error occurs marshalling a message to JSON ErrMarshallingMessage = errors.New("error marshalling message to JSON") // ErrSendingMessage is returned when an error occurs sending a message to the destination ErrSendingMessage = errors.New("error sending message to destination") )
Functions ¶
func WithBehavior ¶
func WithBehavior(behavior Behavior) func(*Multiplexer) *Multiplexer
func WithConfig ¶
func WithConfig(cfg *Config) func(*Multiplexer) *Multiplexer
func WithDestination ¶
func WithDestination(destination publishers.Publisher) func(*Multiplexer) *Multiplexer
func WithLimit ¶
func WithLimit(limit int) func(*Multiplexer) *Multiplexer
func WithReadOnly ¶
func WithReadOnly() func(*Multiplexer) *Multiplexer
func WithReadWrite ¶
func WithReadWrite() func(*Multiplexer) *Multiplexer
func WithSource ¶
func WithSource(source subscribers.Subscriber) func(*Multiplexer) *Multiplexer
func WithWriteOnly ¶
func WithWriteOnly() func(*Multiplexer) *Multiplexer
Types ¶
type Config ¶
type Config struct { // Limit is the maximum number of messages to send // to the destination publisher before ending Limit int `json:"limit"` // Behavior is the behavior to use when sending messages Behavior Behavior `json:"behavior"` }
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type Multiplexer ¶
type Multiplexer struct { // config settings Behavior Behavior Limit int // contains filtered or unexported fields }
func NewMultiplexer ¶
func NewMultiplexer( source subscribers.Subscriber, destination publishers.Publisher, ) *Multiplexer
func (*Multiplexer) Apply ¶
func (m *Multiplexer) Apply(cfg *Config)
Click to show internal directories.
Click to hide internal directories.