Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcknowledgmentOption ¶
type AcknowledgmentOption func(options map[string]interface{})
type ConsumeOpt ¶ added in v0.1.17
type ConsumeOpt func(options interface{}) error
type DeliveryDestination ¶
type IncomingPkg ¶
type IncomingPkg interface {
UID() string
Origin() string
Payload() []byte
Headers() map[string]interface{}
Ack(options ...AcknowledgmentOption) error
Nack(options ...AcknowledgmentOption) error
Reject(options ...AcknowledgmentOption) error
ReceivedAt() time.Time
PublishedAt() time.Time
}
type OutboundPkg ¶
type OutboundPkg interface {
Payload() []byte
ContentType() string
Headers() map[string]interface{}
Destination() DeliveryDestination
}
func NewOutboundPkg ¶
func NewOutboundPkg(payload []byte, contentType string, destination DeliveryDestination, headers map[string]interface{}) OutboundPkg
type Transport ¶
type Transport interface {
// CreateTopic creates a topic(exchange) in message broker
CreateTopic(ctx context.Context, topic Topic) error
// CreateQueue creates a queue in a message broker
CreateQueue(ctx context.Context, queue Queue, queueBind ...QueueBind) error
// Consume starts receiving packages in a goroutine and sends them to the <-chan IncomingPkg
Consume(ctx context.Context, queues []Queue, options ...ConsumeOpt) (<-chan IncomingPkg, error)
// Send sends an outbound package to a defined destination topic in OutboundPkg
Send(ctx context.Context, outboundPkg OutboundPkg, options ...SendOpt) error
// Disconnect disconnects from publishing and consuming channels
Disconnect(context.Context) error
}
Click to show internal directories.
Click to hide internal directories.