Versions in this module Expand all Collapse all v0 v0.0.6 Aug 7, 2022 Changes in this version + const WatermillUUIDHdr v0.0.5 Mar 24, 2022 Changes in this version + type GobMarshaler struct + func (GobMarshaler) Marshal(topic string, msg *message.Message) (*nats.Msg, error) + func (GobMarshaler) Unmarshal(natsMsg *nats.Msg) (*message.Message, error) + type JSONMarshaler struct + func (JSONMarshaler) Marshal(topic string, msg *message.Message) (*nats.Msg, error) + func (JSONMarshaler) Unmarshal(natsMsg *nats.Msg) (*message.Message, error) + type Marshaler interface + Marshal func(topic string, msg *message.Message) (*nats.Msg, error) + type MarshalerUnmarshaler interface + type NATSMarshaler struct + func (*NATSMarshaler) Marshal(topic string, msg *message.Message) (*nats.Msg, error) + func (*NATSMarshaler) Unmarshal(natsMsg *nats.Msg) (*message.Message, error) + type ProtoMarshaler struct + func (*ProtoMarshaler) Marshal(topic string, msg *message.Message) (*nats.Msg, error) + func (*ProtoMarshaler) Unmarshal(msg *nats.Msg) (*message.Message, error) + type Publisher struct + func NewPublisher(config PublisherConfig, logger watermill.LoggerAdapter) (*Publisher, error) + func NewPublisherWithNatsConn(conn *nats.Conn, config PublisherPublishConfig, logger watermill.LoggerAdapter) (*Publisher, error) + func (p *Publisher) Close() error + func (p *Publisher) Publish(topic string, messages ...*message.Message) error + type PublisherConfig struct + AutoProvision bool + JetstreamOptions []nats.JSOpt + Marshaler Marshaler + NatsOptions []nats.Option + PublishOptions []nats.PubOpt + SubjectCalculator SubjectCalculator + TrackMsgId bool + URL string + func (c PublisherConfig) GetPublisherPublishConfig() PublisherPublishConfig + func (c PublisherConfig) Validate() error + type PublisherPublishConfig struct + AutoProvision bool + JetstreamOptions []nats.JSOpt + Marshaler Marshaler + PublishOptions []nats.PubOpt + SubjectCalculator SubjectCalculator + TrackMsgId bool + type SubjectCalculator func(topic string) *Subjects + type Subjects struct + Additional []string + Primary string + func (s *Subjects) All() []string + type Subscriber struct + func NewSubscriber(config SubscriberConfig, logger watermill.LoggerAdapter) (*Subscriber, error) + func NewSubscriberWithNatsConn(conn *nats.Conn, config SubscriberSubscriptionConfig, ...) (*Subscriber, error) + func (s *Subscriber) Close() error + func (s *Subscriber) Subscribe(ctx context.Context, topic string) (<-chan *message.Message, error) + func (s *Subscriber) SubscribeInitialize(topic string) error + type SubscriberConfig struct + AckSync bool + AckWaitTimeout time.Duration + AutoProvision bool + CloseTimeout time.Duration + DurableName string + JetstreamOptions []nats.JSOpt + NatsOptions []nats.Option + QueueGroup string + SubjectCalculator SubjectCalculator + SubscribeOptions []nats.SubOpt + SubscribeTimeout time.Duration + SubscribersCount int + URL string + Unmarshaler Unmarshaler + func (c *SubscriberConfig) GetSubscriberSubscriptionConfig() SubscriberSubscriptionConfig + type SubscriberSubscriptionConfig struct + AckSync bool + AckWaitTimeout time.Duration + AutoProvision bool + CloseTimeout time.Duration + DurableName string + JetstreamOptions []nats.JSOpt + QueueGroup string + SubjectCalculator SubjectCalculator + SubscribeOptions []nats.SubOpt + SubscribeTimeout time.Duration + SubscribersCount int + Unmarshaler Unmarshaler + func (c *SubscriberSubscriptionConfig) Validate() error + type Unmarshaler interface + Unmarshal func(*nats.Msg) (*message.Message, error)