Documentation ¶
Index ¶
- Constants
- Variables
- type Connection
- type ConnectionOptions
- type ExchangeOptions
- type ExchangeType
- type Message
- func (m *Message) Ack() error
- func (m *Message) GetAppID() string
- func (m *Message) GetBody() []byte
- func (m *Message) GetContentEncoding() string
- func (m *Message) GetContentType() string
- func (m *Message) GetCorrelationID() uuid.UUID
- func (m *Message) GetDeliveryMode() uint8
- func (m *Message) GetExpiration() time.Duration
- func (m *Message) GetExpirationString() string
- func (m *Message) GetHeader(key string) interface{}
- func (m *Message) GetHeaders() map[string]interface{}
- func (m *Message) GetID() uuid.UUID
- func (m *Message) GetPriority() uint8
- func (m *Message) GetReplyTo() string
- func (m *Message) GetTimestamp() time.Time
- func (m *Message) GetType() string
- func (m *Message) GetUserID() string
- func (m *Message) Nack() error
- func (m *Message) Reject() error
- func (m *Message) SetAppID(appID string) *Message
- func (m *Message) SetBody(body []byte) *Message
- func (m *Message) SetContentEncoding(v string) *Message
- func (m *Message) SetContentType(v string) *Message
- func (m *Message) SetCorrelationID(id uuid.UUID) *Message
- func (m *Message) SetDeliveryModePersistent() *Message
- func (m *Message) SetExpiration(expiration time.Duration) *Message
- func (m *Message) SetHeader(key string, value interface{}) *Message
- func (m *Message) SetPriority(priority uint8) *Message
- func (m *Message) SetReplyTo(v string) *Message
- func (m *Message) SetTimestamp(timestamp time.Time) *Message
- func (m *Message) SetType(v string) *Message
- func (m *Message) SetUserID(useID string) *Message
- type PublishOptions
- type Publisher
- type PublisherOptions
- type QueueOptions
- type Subscriber
- type SubscriberOptions
Constants ¶
View Source
const ReconnectInterval = 1 * time.Second
Variables ¶
View Source
var (
ErrMessageIsNotDelivery = errors.New("message is not delivery")
)
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { GetConn() *amqp.Connection GetChannel() *amqp.Channel SetReconnectHooks(...func()) }
func NewConnection ¶
func NewConnection(options *ConnectionOptions) Connection
type ConnectionOptions ¶
type ConnectionOptions struct {
URI string
}
type ExchangeOptions ¶
type ExchangeType ¶
type ExchangeType uint8
const ( ExchangeTypeDirect ExchangeType = iota ExchangeTypeFanout ExchangeTypeTopic ExchangeTypeHeaders )
func (ExchangeType) String ¶
func (t ExchangeType) String() string
func (ExchangeType) Value ¶
func (t ExchangeType) Value() ExchangeType
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func NewMessage() *Message
func (*Message) GetContentEncoding ¶
func (*Message) GetContentType ¶
func (*Message) GetCorrelationID ¶
func (*Message) GetDeliveryMode ¶
func (*Message) GetExpiration ¶
func (*Message) GetExpirationString ¶
func (*Message) GetHeaders ¶
func (*Message) GetPriority ¶
func (*Message) GetReplyTo ¶
func (*Message) GetTimestamp ¶
func (*Message) SetContentEncoding ¶
func (*Message) SetContentType ¶
func (*Message) SetDeliveryModePersistent ¶
func (*Message) SetPriority ¶
func (*Message) SetReplyTo ¶
type PublishOptions ¶
type Publisher ¶
type Publisher interface {
Publish(options *PublishOptions, message *Message) error
}
func NewPublisher ¶
func NewPublisher(options *PublisherOptions) Publisher
type PublisherOptions ¶
type PublisherOptions struct {
URI string
}
type QueueOptions ¶
type QueueOptions struct { Name string Durable bool AutoDelete bool Exclusive bool NoWait bool MaxPriority uint8 RoutingKey string QueueBindArgs map[string]interface{} }
func (*QueueOptions) GetArgs ¶
func (o *QueueOptions) GetArgs() amqp.Table
type Subscriber ¶
type Subscriber interface {
Subscribe(handler func(message *Message))
}
func NewSubscriber ¶
func NewSubscriber(options *SubscriberOptions) Subscriber
type SubscriberOptions ¶
Click to show internal directories.
Click to hide internal directories.