Documentation
¶
Index ¶
- type Broadcaster
- type BroadcasterOptions
- type Bus
- func (b *Bus) Migrate(ctx context.Context) error
- func (b *Bus) Publish(ctx context.Context, message *bus.OutboundMessage) error
- func (b *Bus) Subscribe(ctx context.Context, subscriberName string, stream string, ...) (*bus.Subscription, error)
- func (b *Bus) SubscriberInfo(ctx context.Context, stream string, consumerName string) (bus.SubscriberInfo, error)
- type Options
- type SubscribeBroadcastOpts
- type SubscribeOpts
- type Subscriber
- type SubscriberInfo
- type SubscriberOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broadcaster ¶
type Broadcaster struct {
// contains filtered or unexported fields
}
func NewBroadcaster ¶
func NewBroadcaster(opts *BroadcasterOptions) (*Broadcaster, error)
func (*Broadcaster) Broadcast ¶
func (nb *Broadcaster) Broadcast(ctx context.Context, message *bus.OutboundMessage) error
type BroadcasterOptions ¶
type BroadcasterOptions struct {
NATSAddress string
Logger *zap.SugaredLogger
OTelPropagator propagation.TextMapPropagator
}
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
func (*Bus) Subscribe ¶
func (b *Bus) Subscribe(ctx context.Context, subscriberName string, stream string, opts ...bus.SubscribeOption) (*bus.Subscription, error)
func (*Bus) SubscriberInfo ¶ added in v0.14.0
type Options ¶
type Options struct {
NATSAddress string
Logger *zap.Logger
Streams []nats.StreamConfig
OTelPropagator propagation.TextMapPropagator
}
type SubscribeBroadcastOpts ¶
type SubscribeBroadcastOpts struct {
MessageBuffer int
Deserializer serialization.Serializer
}
type SubscribeOpts ¶
type SubscribeOpts struct {
CreateConsumer bool
ConsumerName string
DurableName string
DeliverPolicy *jetstream.DeliverPolicy
// Deprecated: only use for nats < 2.10
FilterSubject string
// use filter subjects for nats >= 2.10
FilterSubjects []string
MaxAckPending int
MaxDeliverTries int
MessageBuffer int
Deserializer serialization.Serializer
}
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func NewSubscriber ¶
func NewSubscriber(opts *SubscriberOptions) (*Subscriber, error)
func (*Subscriber) Subscribe ¶
func (ns *Subscriber) Subscribe(ctx context.Context, streamName string, opts *SubscribeOpts) (*bus.Subscription, error)
func (*Subscriber) SubscribeBroadcast ¶
func (ns *Subscriber) SubscribeBroadcast(ctx context.Context, subject string, opts *SubscribeBroadcastOpts) (*bus.Subscription, error)
type SubscriberInfo ¶ added in v0.14.0
type SubscriberInfo struct {
// contains filtered or unexported fields
}
func (*SubscriberInfo) HasPendingMessages ¶ added in v0.14.0
func (si *SubscriberInfo) HasPendingMessages() bool
type SubscriberOptions ¶
type SubscriberOptions struct {
NATSAddress string
OTelPropagator propagation.TextMapPropagator
}
Click to show internal directories.
Click to hide internal directories.