Documentation ¶
Index ¶
- Constants
- func New(connOpt ConnectionOption, opts ...Option) (easypubsub.Publisher, error)
- type ConnectionOption
- type Exchange
- type MarshalMsgFunc
- type MessageProperties
- type Option
- func WithExchange(exchange *Exchange) Option
- func WithLogger(logger easypubsub.Logger) Option
- func WithMarshalMsgFunc(marshalMsgFunc MarshalMsgFunc) Option
- func WithMessageProperties(msgProps *MessageProperties) Option
- func WithPublishOptions(publish *Publish) Option
- func WithTransactional(enabled bool) Option
- type Publish
- type PublishResult
- type Publisher
Constants ¶
View Source
const ( NORMAL = 0 CLOSED = 1 )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(connOpt ConnectionOption, opts ...Option) (easypubsub.Publisher, error)
Types ¶
type ConnectionOption ¶
type ConnectionOption func(o *connectionOptions)
func Connection ¶
func Connection(url string) ConnectionOption
func ConnectionWithConfig ¶
func ConnectionWithConfig(url string, amqpConfig *amqp.Config) ConnectionOption
func ConnectionWithTLS ¶
func ConnectionWithTLS(url string, tlsConfig *tls.Config) ConnectionOption
type MarshalMsgFunc ¶
type MarshalMsgFunc func(topic string, msg *easypubsub.Message, msgProps *MessageProperties) (*amqp.Publishing, error)
type MessageProperties ¶
type MessageProperties struct { ContentType string // MIME content type ContentEncoding string // MIME content encoding DeliveryMode uint8 // Transient (0 or 1) or Persistent (2) Priority uint8 // 0 to 9 CorrelationId string // correlation identifier ReplyTo string // address to to reply to (ex: RPC) Expiration string // message expiration spec MessageId string // message identifier Timestamp time.Time // message timestamp Type string // message type name UserId string // creating user id - ex: "guest" AppId string // creating application id }
type Option ¶
type Option func(o *options)
func WithExchange ¶
func WithLogger ¶
func WithLogger(logger easypubsub.Logger) Option
func WithMarshalMsgFunc ¶
func WithMarshalMsgFunc(marshalMsgFunc MarshalMsgFunc) Option
func WithMessageProperties ¶
func WithMessageProperties(msgProps *MessageProperties) Option
func WithPublishOptions ¶
func WithTransactional ¶
type PublishResult ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func (*Publisher) Publish ¶
func (pub *Publisher) Publish(topic string, msg *easypubsub.Message) *easypubsub.PublishResult
Click to show internal directories.
Click to hide internal directories.