Documentation
¶
Index ¶
- Variables
- type DirectMessaging
- type EnqueueOptions
- type MessageQueue
- type NATsMessageQueueManager
- type PubSub
- type StreamPubsub
- type StreamPubsubOption
- func WithAckWait(ackWait time.Duration) StreamPubsubOption
- func WithConsumerNamePrefix(prefix string) StreamPubsubOption
- func WithDescription(description string) StreamPubsubOption
- func WithDiscardPolicy(policy nats.DiscardPolicy) StreamPubsubOption
- func WithMaxAge(maxAge time.Duration) StreamPubsubOption
- func WithMaxDeliveryAttempts(maxAttempts int) StreamPubsubOption
- func WithRetention(policy nats.RetentionPolicy) StreamPubsubOption
- func WithStorage(storage nats.StorageType) StreamPubsubOption
- type Subscription
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrPermament = errors.New("Permanent messaging error")
)
Functions ¶
This section is empty.
Types ¶
type DirectMessaging ¶
type DirectMessaging interface {
Listen(target string, handler func(data []byte)) (Subscription, error)
Send(target string, data []byte) error
}
func NewNatsDirectMessaging ¶
func NewNatsDirectMessaging(natsConn *nats.Conn) DirectMessaging
type EnqueueOptions ¶
type EnqueueOptions struct {
IdempotententKey string
}
type MessageQueue ¶
type NATsMessageQueueManager ¶
type NATsMessageQueueManager struct {
// contains filtered or unexported fields
}
func NewNATsMessageQueueManager ¶
func NewNATsMessageQueueManager(queueName string, subjectWildCards []string, nc *nats.Conn) *NATsMessageQueueManager
func (*NATsMessageQueueManager) NewMessageQueue ¶
func (m *NATsMessageQueueManager) NewMessageQueue(consumerName string) MessageQueue
type PubSub ¶
type PubSub interface {
Publish(topic string, message []byte) error
PublishWithReply(ttopic, reply string, data []byte) error
Subscribe(topic string, handler func(msg *nats.Msg)) (Subscription, error)
}
func NewNATSPubSub ¶
type StreamPubsub ¶
type StreamPubsub interface {
Publish(topic string, message []byte) error
Subscribe(name string, topic string, handler func(msg jetstream.Msg)) (Subscription, error)
}
func NewJetStreamPubSub ¶
func NewJetStreamPubSub(natsConn *nats.Conn, streamName string, subjects []string, opts ...StreamPubsubOption) (StreamPubsub, error)
type StreamPubsubOption ¶
type StreamPubsubOption func(*streamPubSubConfig)
func WithAckWait ¶
func WithAckWait(ackWait time.Duration) StreamPubsubOption
func WithConsumerNamePrefix ¶
func WithConsumerNamePrefix(prefix string) StreamPubsubOption
func WithDescription ¶
func WithDescription(description string) StreamPubsubOption
func WithDiscardPolicy ¶
func WithDiscardPolicy(policy nats.DiscardPolicy) StreamPubsubOption
func WithMaxAge ¶
func WithMaxAge(maxAge time.Duration) StreamPubsubOption
func WithMaxDeliveryAttempts ¶
func WithMaxDeliveryAttempts(maxAttempts int) StreamPubsubOption
func WithRetention ¶
func WithRetention(policy nats.RetentionPolicy) StreamPubsubOption
func WithStorage ¶
func WithStorage(storage nats.StorageType) StreamPubsubOption
type Subscription ¶
type Subscription interface {
Unsubscribe() error
}
Click to show internal directories.
Click to hide internal directories.